From 8ee461ce5c9cdd117b0e4b9f8dfec0a388d37f29 Mon Sep 17 00:00:00 2001 From: Ricky Kresslein Date: Thu, 28 Apr 2022 19:18:15 +0300 Subject: Add Pomodoro timer --- src/ui/preferences_window.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/ui/preferences_window.rs') diff --git a/src/ui/preferences_window.rs b/src/ui/preferences_window.rs index 47a7adc..6436026 100755 --- a/src/ui/preferences_window.rs +++ b/src/ui/preferences_window.rs @@ -57,6 +57,13 @@ mod imp { pub show_daily_sums_switch: TemplateChild, #[template_child] pub show_tags_switch: TemplateChild, + + #[template_child] + pub timer_group: TemplateChild, + #[template_child] + pub pomodoro_expander: TemplateChild, + #[template_child] + pub pomodoro_spin: TemplateChild, } #[glib::object_subclass] @@ -175,6 +182,18 @@ impl FurPreferencesWindow { "active" ); + settings_manager::bind_property( + "pomodoro", + &*imp.pomodoro_expander, + "enable-expansion" + ); + + settings_manager::bind_property( + "pomodoro-time", + &*imp.pomodoro_spin, + "value" + ); + imp.dark_theme_switch.connect_active_notify(move |_|{ let app = FurtheranceApplication::default(); app.update_light_dark(); @@ -204,6 +223,16 @@ impl FurPreferencesWindow { let window = FurtheranceWindow::default(); window.reset_history_box(); }); + + imp.pomodoro_expander.connect_enable_expansion_notify(move |_|{ + let window = FurtheranceWindow::default(); + window.refresh_timer(); + }); + + imp.pomodoro_spin.connect_value_changed(move |_|{ + let window = FurtheranceWindow::default(); + window.refresh_timer(); + }); } } -- cgit 1.4.1