From 238cb3f6717547fc522a4c41c8e9d729b1e1ba10 Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Wed, 11 May 2022 01:27:06 +0200 Subject: Fix previous commit: text not turning red when overtime when the app was open; remove unused code 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(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) { -- cgit v0.10.2