diff options
Diffstat (limited to 'src/displayapp/DisplayApp.cpp')
| -rw-r--r-- | src/displayapp/DisplayApp.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 233f433..cc544fd 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -45,9 +45,10 @@ #include "displayapp/screens/settings/SettingWakeUp.h" #include "displayapp/screens/settings/SettingDisplay.h" #include "displayapp/screens/settings/SettingSteps.h" -#include "displayapp/screens/settings/SettingPineTimeStyle.h" #include "displayapp/screens/settings/SettingSetDate.h" #include "displayapp/screens/settings/SettingSetTime.h" +#include "displayapp/screens/settings/SettingChimes.h" +#include "displayapp/screens/settings/SettingShakeThreshold.h" #include "libs/lv_conf.h" @@ -255,10 +256,10 @@ void DisplayApp::Refresh() { } } break; case Messages::ButtonPushed: - if (currentApp == Apps::Clock) { - PushMessageToSystemTask(System::Messages::GoToSleep); - } else { - if (!currentScreen->OnButtonPushed()) { + if (!currentScreen->OnButtonPushed()) { + if (currentApp == Apps::Clock) { + PushMessageToSystemTask(System::Messages::GoToSleep); + } else { LoadApp(returnToApp, returnDirection); brightnessController.Set(settingsController.GetBrightness()); brightnessController.Backup(); @@ -293,6 +294,9 @@ void DisplayApp::Refresh() { // Added to remove warning // What should happen here? break; + case Messages::Clock: + LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::None); + break; } } @@ -363,12 +367,12 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) case Apps::Notifications: currentScreen = std::make_unique<Screens::Notifications>( - this, notificationManager, systemTask->nimble().alertService(), motorController, Screens::Notifications::Modes::Normal); + this, notificationManager, systemTask->nimble().alertService(), motorController, *systemTask, Screens::Notifications::Modes::Normal); ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp); break; case Apps::NotificationsPreview: currentScreen = std::make_unique<Screens::Notifications>( - this, notificationManager, systemTask->nimble().alertService(), motorController, Screens::Notifications::Modes::Preview); + this, notificationManager, systemTask->nimble().alertService(), motorController, *systemTask, Screens::Notifications::Modes::Preview); ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp); break; case Apps::Timer: @@ -416,8 +420,12 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) currentScreen = std::make_unique<Screens::SettingSetTime>(this, dateTimeController); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); break; - case Apps::SettingPineTimeStyle: - currentScreen = std::make_unique<Screens::SettingPineTimeStyle>(this, settingsController); + case Apps::SettingChimes: + currentScreen = std::make_unique<Screens::SettingChimes>(this, settingsController); + ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); + break; + case Apps::SettingShakeThreshold: + currentScreen = std::make_unique<Screens::SettingShakeThreshold>(this, settingsController,motionController,*systemTask); ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown); break; case Apps::BatteryInfo: |
