diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/settings_manager.rs | 6 | ||||
-rw-r--r-- | src/ui/preferences_window.rs | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/settings_manager.rs b/src/settings_manager.rs index 18c341f..d50438e 100644 --- a/src/settings_manager.rs +++ b/src/settings_manager.rs @@ -47,3 +47,9 @@ pub fn get_string(key: &str) -> String { let settings = get_settings(); settings.string(key).to_string() } + +#[allow(dead_code)] +pub fn set_int(key: &str, val: i32) { + let settings = get_settings(); + _ = settings.set_int(key, val); +} diff --git a/src/ui/preferences_window.rs b/src/ui/preferences_window.rs index ac0021d..c7f6344 100644 --- a/src/ui/preferences_window.rs +++ b/src/ui/preferences_window.rs @@ -216,9 +216,10 @@ impl FurPreferencesWindow { .connect_enable_expansion_notify(move |_| { let window = FurtheranceWindow::default(); window.refresh_timer(); - }); + }); - imp.pomodoro_spin.connect_value_changed(move |_| { + imp.pomodoro_spin.connect_value_changed(move |new_val| { + settings_manager::set_int("pomodoro-time", new_val.value() as i32); let window = FurtheranceWindow::default(); window.refresh_timer(); }); |