aboutsummaryrefslogtreecommitdiff
path: root/src/controllers/timer_view.cpp
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2023-07-13 13:03:59 -0500
committerFurkan Sahin <furkan-dev@proton.me>2023-07-13 13:03:59 -0500
commit1b5479c24ae601bf3a3732201fcee7ce3f60d9d0 (patch)
tree25be62bb283299c1e068468d66f864904069959b /src/controllers/timer_view.cpp
parent6abbce31eaa83ce429210f559709fab6adbb303d (diff)
Fix counter to show overtime value when preset, offer reset before a clear when a counter is incremented
Diffstat (limited to 'src/controllers/timer_view.cpp')
-rw-r--r--src/controllers/timer_view.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/controllers/timer_view.cpp b/src/controllers/timer_view.cpp
index 28abd5c..841d7f7 100644
--- a/src/controllers/timer_view.cpp
+++ b/src/controllers/timer_view.cpp
@@ -68,6 +68,7 @@ class TimerView {
}
_update_clear_reset_btn_label();
+ _update_clear_reset_btn();
}
/*
@@ -89,6 +90,8 @@ class TimerView {
_counters[counter_num].inc();
_update_counter(counter_num);
+
+ _update_clear_reset_btn_label();
}
void handle_timer_update() {
@@ -181,7 +184,7 @@ class TimerView {
}
bool _clear_reset_btn_clears() const {
- return _timer.has_preset() and !_timer.started();
+ return _timer.has_preset() and !_timer.started() and (_counters[0].cnt() == 0 && _counters[1].cnt() == 0);
}
void _update_clear_reset_btn_label() {