about summary refs log tree commit diff
path: root/src/ui/tasks_page.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/tasks_page.rs
parenteb80833b5d736180baa49c7f3787fe30eba161db (diff)
downloadFurtherance-41d197cc21053b221ebc5af06efec66f77579e13.tar.zst
Add preferences toggle for daily sums
Diffstat (limited to 'src/ui/tasks_page.rs')
-rwxr-xr-xsrc/ui/tasks_page.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/ui/tasks_page.rs b/src/ui/tasks_page.rs
index ac4e20e..7fb6e63 100755
--- a/src/ui/tasks_page.rs
+++ b/src/ui/tasks_page.rs
@@ -154,16 +154,18 @@ impl FurTasksPage {
             group.add_task_model(tasks_sorted_by_day[i].clone());
 
             // Set total time for each day
-            let day_total_time = group.get_total_day_time();
-            // Format total time to readable string
-            let h = day_total_time / 3600;
-            let m = day_total_time % 3600 / 60;
-            let s = day_total_time % 60;
-            let mut total_time_str = format!("{:02}:{:02}:{:02}", h, m, s);
-            if !settings_manager::get_bool("show-seconds") {
-                total_time_str = format!("{:02}:{:02}", h, m);
+            if settings_manager::get_bool("show-daily-sums") {
+                let day_total_time = group.get_total_day_time();
+                // Format total time to readable string
+                let h = day_total_time / 3600;
+                let m = day_total_time % 3600 / 60;
+                let s = day_total_time % 60;
+                let mut total_time_str = format!("{:02}:{:02}:{:02}", h, m, s);
+                if !settings_manager::get_bool("show-seconds") {
+                    total_time_str = format!("{:02}:{:02}", h, m);
+                }
+                group.set_description(Some(&total_time_str));
             }
-            group.set_description(Some(&total_time_str));
 
             imp.all_groups.borrow_mut().push(group);
         }