From de4ea78d38007a2efda4cbd03d0207fa27decbf4 Mon Sep 17 00:00:00 2001 From: Ricky Kresslein Date: Wed, 23 Feb 2022 22:54:50 +0100 Subject: - Clearly states idle notify works in Gnome only - Fixed bug idle preference only updated on start - Added dark theme switch --- src/ui/preferences_window.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/ui/preferences_window.rs') diff --git a/src/ui/preferences_window.rs b/src/ui/preferences_window.rs index e9ef36e..b6088ec 100644 --- a/src/ui/preferences_window.rs +++ b/src/ui/preferences_window.rs @@ -30,6 +30,11 @@ mod imp { #[derive(Default, Debug, CompositeTemplate)] #[template(resource = "/com/lakoliu/Furtherance/gtk/preferences_window.ui")] pub struct FurPreferencesWindow { + #[template_child] + pub appearance_group: TemplateChild, + #[template_child] + pub dark_theme_switch: TemplateChild, + #[template_child] pub idle_group: TemplateChild, #[template_child] @@ -88,12 +93,21 @@ impl FurPreferencesWindow { } fn setup_widgets(&self) { + let imp = imp::FurPreferencesWindow::from_instance(self); + let manager = adw::StyleManager::default(); + let support_darkmode = manager.system_supports_color_schemes(); + imp.appearance_group.set_visible(!support_darkmode); } fn setup_signals(&self) { let imp = imp::FurPreferencesWindow::from_instance(self); + settings_manager::bind_property( + "dark-mode", + &*imp.dark_theme_switch, + "active"); + settings_manager::bind_property( "notify-of-idle", &*imp.notify_of_idle_expander, -- cgit 1.4.1