about summary refs log tree commit diff
path: root/src/ui
diff options
context:
space:
mode:
authorLakoLiu <99976966+lakoliu@users.noreply.github.com>2024-02-13 07:45:17 +0100
committerGitHub <noreply@github.com>2024-02-13 07:45:17 +0100
commit07b9596cc1fe5b2442ade60fd7d00408482ddbf2 (patch)
treed391bb026bebad5eb320e56f6245bccc2366bcff /src/ui
parent7c3ebca6549dd53c3c0c039854d880f761a3a952 (diff)
parent366e9cee77c04d4a381f55d6ee8ce4c15e0d0c3b (diff)
downloadFurtherance-07b9596cc1fe5b2442ade60fd7d00408482ddbf2.tar.zst
Merge pull request #129 from gabrbrand/adw-1-4
Port to libadwaita 1.4 widgets
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/preferences_window.rs53
1 files changed, 26 insertions, 27 deletions
diff --git a/src/ui/preferences_window.rs b/src/ui/preferences_window.rs
index d3de8de..90a28ff 100644
--- a/src/ui/preferences_window.rs
+++ b/src/ui/preferences_window.rs
@@ -33,56 +33,56 @@ mod imp {
     #[derive(Default, Debug, CompositeTemplate)]
     #[template(resource = "/com/lakoliu/Furtherance/gtk/preferences_window.ui")]
     pub struct FurPreferencesWindow {
+        // General Page
+        // Appearance Group
         #[template_child]
         pub appearance_group: TemplateChild<adw::PreferencesGroup>,
         #[template_child]
-        pub dark_theme_switch: TemplateChild<gtk::Switch>,
+        pub dark_theme_switch: TemplateChild<adw::SwitchRow>,
 
-        #[template_child]
-        pub idle_group: TemplateChild<adw::PreferencesGroup>,
+        // Idle Group
         #[template_child]
         pub notify_of_idle_expander: TemplateChild<adw::ExpanderRow>,
         #[template_child]
-        pub notify_of_idle_spin: TemplateChild<gtk::SpinButton>,
+        pub notify_of_idle_spin: TemplateChild<adw::SpinRow>,
 
+        // Timer Group
         #[template_child]
-        pub task_list_group: TemplateChild<adw::PreferencesGroup>,
-        #[template_child]
-        pub limit_tasks_expander: TemplateChild<adw::ExpanderRow>,
-        #[template_child]
-        pub limit_days_spin: TemplateChild<gtk::SpinButton>,
+        pub pomodoro_expander: TemplateChild<adw::ExpanderRow>,
         #[template_child]
-        pub delete_confirmation_switch: TemplateChild<gtk::Switch>,
+        pub pomodoro_spin: TemplateChild<adw::SpinRow>,
         #[template_child]
-        pub show_seconds_switch: TemplateChild<gtk::Switch>,
+        pub autosave_expander: TemplateChild<adw::ExpanderRow>,
         #[template_child]
-        pub show_daily_sums_switch: TemplateChild<gtk::Switch>,
+        pub autosave_spin: TemplateChild<adw::SpinRow>,
         #[template_child]
-        pub show_tags_switch: TemplateChild<gtk::Switch>,
+        pub inclusive_total_switch: TemplateChild<adw::SwitchRow>,
 
+        // Tasks Page
+        // Task List Group
         #[template_child]
-        pub task_input_group: TemplateChild<adw::PreferencesGroup>,
+        pub delete_confirmation_switch: TemplateChild<adw::SwitchRow>,
         #[template_child]
-        pub autocomplete_switch: TemplateChild<gtk::Switch>,
-
-        #[template_child]
-        pub timer_group: TemplateChild<adw::PreferencesGroup>,
+        pub limit_tasks_expander: TemplateChild<adw::ExpanderRow>,
         #[template_child]
-        pub pomodoro_expander: TemplateChild<adw::ExpanderRow>,
+        pub limit_days_spin: TemplateChild<adw::SpinRow>,
         #[template_child]
-        pub pomodoro_spin: TemplateChild<gtk::SpinButton>,
-
+        pub show_daily_sums_switch: TemplateChild<adw::SwitchRow>,
         #[template_child]
-        pub autosave_expander: TemplateChild<adw::ExpanderRow>,
+        pub show_seconds_switch: TemplateChild<adw::SwitchRow>,
         #[template_child]
-        pub autosave_spin: TemplateChild<gtk::SpinButton>,
+        pub show_tags_switch: TemplateChild<adw::SwitchRow>,
 
+        // Task Input Group
         #[template_child]
-        pub inclusive_total_switch: TemplateChild<gtk::Switch>,
+        pub autocomplete_switch: TemplateChild<adw::SwitchRow>,
 
+        // Data Page
+        // Reports Group
         #[template_child]
         pub week_start_combo: TemplateChild<adw::ComboRow>,
 
+        // Database Group
         #[template_child]
         pub database_loc_row: TemplateChild<adw::ActionRow>,
         #[template_child]
@@ -209,7 +209,7 @@ impl FurPreferencesWindow {
                 window.reset_history_box();
             });
 
-        imp.limit_days_spin.connect_value_changed(move |_| {
+        imp.limit_days_spin.connect_value_notify(move |_| {
             let window = FurtheranceWindow::default();
             window.reset_history_box();
         });
@@ -240,7 +240,7 @@ impl FurPreferencesWindow {
                 window.refresh_timer();
         });
 
-        imp.pomodoro_spin.connect_value_changed(move |new_val| {
+        imp.pomodoro_spin.connect_value_notify(move |new_val| {
             settings_manager::set_int("pomodoro-time", new_val.value() as i32);
             let window = FurtheranceWindow::default();
             window.refresh_timer();
@@ -299,4 +299,3 @@ impl FurPreferencesWindow {
         }));
     }
 }
-