From 0f05a52d429c41b538fa3b362cad3a54db04e5cd Mon Sep 17 00:00:00 2001 From: Ricky Kresslein Date: Thu, 3 Mar 2022 10:02:01 +0100 Subject: Added 'limit days shown' setting --- src/ui/preferences_window.rs | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'src/ui/preferences_window.rs') diff --git a/src/ui/preferences_window.rs b/src/ui/preferences_window.rs index b6088ec..644ca22 100755 --- a/src/ui/preferences_window.rs +++ b/src/ui/preferences_window.rs @@ -41,6 +41,13 @@ mod imp { pub notify_of_idle_expander: TemplateChild, #[template_child] pub notify_of_idle_spin: TemplateChild, + + #[template_child] + pub task_group: TemplateChild, + #[template_child] + pub limit_tasks_expander: TemplateChild, + #[template_child] + pub limit_days_spin: TemplateChild, } #[glib::object_subclass] @@ -119,7 +126,28 @@ impl FurPreferencesWindow { &*imp.notify_of_idle_spin, "value", ); - } + settings_manager::bind_property( + "limit-tasks", + &*imp.limit_tasks_expander, + "enable-expansion", + ); + + settings_manager::bind_property( + "limit-days", + &*imp.limit_days_spin, + "value", + ); + + imp.limit_tasks_expander.connect_enable_expansion_notify(move |_|{ + let window = FurtheranceWindow::default(); + window.reset_history_box(); + }); + + imp.limit_days_spin.connect_value_changed(move |_|{ + let window = FurtheranceWindow::default(); + window.reset_history_box(); + }); + } } -- cgit 1.4.1