summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-05-10 23:27:06 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-05-11 01:41:52 (GMT)
commit238cb3f6717547fc522a4c41c8e9d729b1e1ba10 (patch)
tree066e7a9ae462aac2a3023d933dca968d630b2bc6
parent20bf019ed739231714620010248f7e9e409aa919 (diff)
Fix previous commit: text not turning red when overtime when the app was open; remove unused code
-rw-r--r--src/displayapp/DisplayApp.cpp5
-rw-r--r--src/displayapp/screens/Timer.h5
2 files changed, 7 insertions, 3 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index 0ce1002..5c5aad2 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -184,7 +184,10 @@ void DisplayApp::Refresh() {
LoadApp(Apps::NotificationsPreview, DisplayApp::FullRefreshDirections::Down);
break;
case Messages::TimerDone:
- if (currentApp != Apps::Timer) {
+ if (currentApp == Apps::Timer) {
+ auto* timer = static_cast<Screens::Timer*>(currentScreen.get());
+ timer->SetDone();
+ } else {
LoadApp(Apps::Timer, DisplayApp::FullRefreshDirections::Down);
}
break;
diff --git a/src/displayapp/screens/Timer.h b/src/displayapp/screens/Timer.h
index dd55602..3f6d782 100644
--- a/src/displayapp/screens/Timer.h
+++ b/src/displayapp/screens/Timer.h
@@ -11,14 +11,15 @@ namespace Pinetime::Applications::Screens {
class Timer : public Screen {
public:
- enum class Modes { Normal, Done };
-
Timer(DisplayApp* app, Controllers::TimerController& timerController);
~Timer() override;
void Refresh() override;
void RefreshRunning();
+ inline void SetDone() {
+ RefreshRunning();
+ }
private:
static void btnEventHandler(lv_obj_t* obj, lv_event_t event);
inline void OnButtonEvent(lv_obj_t* obj, lv_event_t event) {