Add basic settings to toolbox page

This commit is contained in:
2022-04-02 23:08:40 +02:00
parent 19234129c6
commit 3f7fb7c84b

View File

@@ -37,6 +37,7 @@ enum AppMsg {
impl Widgets<ToolboxSettingsDialogModel, AppModel> for ToolboxSettingsDialogWidgets { impl Widgets<ToolboxSettingsDialogModel, AppModel> for ToolboxSettingsDialogWidgets {
view! { view! {
adw::PreferencesWindow { adw::PreferencesWindow {
set_title: Some("Preferences: <Toolbox_name>"),
set_transient_for: parent!{Some(&parent_widgets.main_window)}, set_transient_for: parent!{Some(&parent_widgets.main_window)},
set_modal: true, set_modal: true,
set_visible: watch!(!model.hidden), set_visible: watch!(!model.hidden),
@@ -46,21 +47,51 @@ impl Widgets<ToolboxSettingsDialogModel, AppModel> for ToolboxSettingsDialogWidg
}, },
add = &adw::PreferencesPage { add = &adw::PreferencesPage {
add = &adw::PreferencesGroup { add = &adw::PreferencesGroup {
set_title: "Group", set_title: "Update",
add = &adw::PreferencesRow { add = &adw::PreferencesRow {
set_title: "RowSearchable", set_title: "Updates",
set_child = Some(&adw::ActionRow) { set_child = Some(&adw::ActionRow) {
set_title: "Test", set_title: "Update automatically",
set_subtitle: "additional information",
add_suffix = &gtk::Box { add_suffix = &gtk::Box {
append = &gtk::Switch { append = &gtk::Switch {
set_margin_all: 15, set_margin_all: 15,
set_tooltip_text: Some("Use global settings"), set_tooltip_text: Some("Update applications automatically"),
}, },
} }
}, },
},
} },
add = &adw::PreferencesGroup {
set_title: "Home Folder",
add = &adw::PreferencesRow {
set_title: "Seperate Home Folder",
set_child = Some(&adw::ActionRow) {
set_title: "Use separate home folder",
add_suffix = &gtk::Box {
append = &gtk::Switch {
set_margin_all: 15,
set_tooltip_text: Some("Use separate home folder"),
},
}
},
},
add = &adw::PreferencesRow {
set_title: "Home Folder Path",
set_child = Some(&adw::ActionRow) {
set_title: "Home folder path",
add_suffix = &gtk::Box {
set_margin_all: 15,
add_css_class: "linked",
append = &gtk::Entry {
set_hexpand: true,
},
append = &gtk::Button {
}
}
},
},
} }
} }
} }