From 19234129c6e1c296f7a768f244c3bd2bd20b7c21 Mon Sep 17 00:00:00 2001 From: Hannes Kuchelmeister Date: Sat, 2 Apr 2022 13:11:01 +0200 Subject: [PATCH] add first action row to settings --- src/main.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 98e044b..a4a81c5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use adw::prelude::AdwApplicationWindowExt; use gtk::prelude::{BoxExt, GtkWindowExt, OrientableExt}; -use relm4::{adw::{self, traits::{PreferencesRowExt, ActionRowExt}, prelude::{WidgetExt, ButtonExt}}, gtk::{self, SelectionMode}, AppUpdate, Model, RelmApp, Sender, WidgetPlus, Widgets, factory::{FactoryVec, FactoryPrototype}, view, RelmComponent, Components, send, ComponentUpdate}; +use relm4::{adw::{self, traits::{PreferencesRowExt, ActionRowExt, AdwWindowExt, PreferencesPageExt, PreferencesWindowExt, PreferencesGroupExt}, prelude::{WidgetExt, ButtonExt, ListBoxRowExt}}, gtk::{self, SelectionMode}, AppUpdate, Model, RelmApp, Sender, WidgetPlus, Widgets, factory::{FactoryVec, FactoryPrototype}, view, RelmComponent, Components, send, ComponentUpdate}; const START_ICON : &str = r#"media-playback-start-symbolic"#; const START_TOOLTIP : &str = r#"Start toolbox"#; @@ -43,6 +43,25 @@ impl Widgets for ToolboxSettingsDialogWidg connect_close_request(sender) => move |_| { send!(sender, ToolboxSettingsDialogMsg::Close); gtk::Inhibit(true) + }, + add = &adw::PreferencesPage { + add = &adw::PreferencesGroup { + set_title: "Group", + add = &adw::PreferencesRow { + set_title: "RowSearchable", + set_child = Some(&adw::ActionRow) { + set_title: "Test", + set_subtitle: "additional information", + add_suffix = >k::Box { + append = >k::Switch { + set_margin_all: 15, + set_tooltip_text: Some("Use global settings"), + }, + } + }, + + } + } } } }