about summary refs log tree commit diff
path: root/src/ui/preferences_window.rs
diff options
context:
space:
mode:
authorRicky Kresslein <rk@lakoliu.com>2022-04-14 17:54:57 +0300
committerRicky Kresslein <rk@lakoliu.com>2022-04-14 17:54:57 +0300
commit41d197cc21053b221ebc5af06efec66f77579e13 (patch)
treeba2149cdf543911f18a4ed2223fe21d0f317f915 /src/ui/preferences_window.rs
parenteb80833b5d736180baa49c7f3787fe30eba161db (diff)
downloadFurtherance-41d197cc21053b221ebc5af06efec66f77579e13.tar.zst
Add preferences toggle for daily sums
Diffstat (limited to 'src/ui/preferences_window.rs')
-rwxr-xr-xsrc/ui/preferences_window.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ui/preferences_window.rs b/src/ui/preferences_window.rs
index 36e83dc..1955d09 100755
--- a/src/ui/preferences_window.rs
+++ b/src/ui/preferences_window.rs
@@ -53,6 +53,8 @@ mod imp {
         pub delete_confirmation_switch: TemplateChild<gtk::Switch>,
         #[template_child]
         pub show_seconds_switch: TemplateChild<gtk::Switch>,
+        #[template_child]
+        pub show_daily_sums_switch: TemplateChild<gtk::Switch>,
     }
 
     #[glib::object_subclass]
@@ -159,6 +161,12 @@ impl FurPreferencesWindow {
             "active"
         );
 
+        settings_manager::bind_property(
+            "show-daily-sums",
+            &*imp.show_daily_sums_switch,
+            "active"
+        );
+
         imp.dark_theme_switch.connect_active_notify(move |_|{
             let app = FurtheranceApplication::default();
             app.update_light_dark();
@@ -178,6 +186,11 @@ impl FurPreferencesWindow {
             let window = FurtheranceWindow::default();
             window.reset_history_box();
         });
+
+        imp.show_daily_sums_switch.connect_active_notify(move |_|{
+            let window = FurtheranceWindow::default();
+            window.reset_history_box();
+        });
     }
 }