about summary refs log tree commit diff
path: root/src/ui/preferences_window.rs
diff options
context:
space:
mode:
authorRicky Kresslein <ricky@kressle.in>2022-02-23 22:54:50 +0100
committerRicky Kresslein <ricky@kressle.in>2022-02-23 22:54:50 +0100
commitde4ea78d38007a2efda4cbd03d0207fa27decbf4 (patch)
tree77f642be49be3656276628b8fc885a5f5d169c86 /src/ui/preferences_window.rs
parent2a8e1c75863bc84c55eadcff1f3adb42d409d180 (diff)
downloadFurtherance-de4ea78d38007a2efda4cbd03d0207fa27decbf4.tar.zst
- Clearly states idle notify works in Gnome only
- Fixed bug idle preference only updated on start
- Added dark theme switch
Diffstat (limited to 'src/ui/preferences_window.rs')
-rw-r--r--src/ui/preferences_window.rs14
1 files changed, 14 insertions, 0 deletions
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
@@ -31,6 +31,11 @@ mod imp {
     #[template(resource = "/com/lakoliu/Furtherance/gtk/preferences_window.ui")]
     pub struct FurPreferencesWindow {
         #[template_child]
+        pub appearance_group: TemplateChild<adw::PreferencesGroup>,
+        #[template_child]
+        pub dark_theme_switch: TemplateChild<gtk::Switch>,
+
+        #[template_child]
         pub idle_group: TemplateChild<adw::PreferencesGroup>,
         #[template_child]
         pub notify_of_idle_expander: TemplateChild<adw::ExpanderRow>,
@@ -88,13 +93,22 @@ 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,
             "enable-expansion",