diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d903629b17..83bbcb27c2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -610,8 +610,8 @@ set(INCLUDE_FILES displayapp/screens/FirmwareValidation.h displayapp/screens/ApplicationList.h displayapp/screens/CheckboxList.h - displayapp/Apps.h displayapp/WatchFaces.h + displayapp/ScreenIds.h displayapp/screens/Notifications.h displayapp/screens/HeartRate.h displayapp/screens/Metronome.h diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index a930fe961c..9b01575694 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -107,9 +107,9 @@ void DisplayApp::Start(System::BootErrors error) { lvgl.Init(); if (error == System::BootErrors::TouchController) { - LoadNewScreen(Apps::Error, DisplayApp::FullRefreshDirections::None); + LoadNewScreen(ScreenId::Error, DisplayApp::FullRefreshDirections::None); } else { - LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None); + LoadNewScreen(ScreenId::Clock, DisplayApp::FullRefreshDirections::None); } if (pdPASS != xTaskCreate(DisplayApp::Process, "displayapp", 800, this, 0, &taskHandle)) { @@ -140,7 +140,7 @@ void DisplayApp::InitHw() { void DisplayApp::Refresh() { auto LoadPreviousScreen = [this]() { FullRefreshDirections returnDirection; - switch (appStackDirections.Pop()) { + switch (stackDirections.Pop()) { case FullRefreshDirections::Up: returnDirection = FullRefreshDirections::Down; break; @@ -157,7 +157,7 @@ void DisplayApp::Refresh() { returnDirection = FullRefreshDirections::None; break; } - LoadScreen(returnAppStack.Pop(), returnDirection); + LoadScreen(returnStack.Pop(), returnDirection); }; auto DimScreen = [this]() { @@ -240,31 +240,31 @@ void DisplayApp::Refresh() { // Screens::Clock::BleConnectionStates::NotConnected); break; case Messages::NewNotification: - LoadNewScreen(Apps::NotificationsPreview, DisplayApp::FullRefreshDirections::Down); + LoadNewScreen(ScreenId::NotificationsPreview, DisplayApp::FullRefreshDirections::Down); break; case Messages::TimerDone: if (state != States::Running) { PushMessageToSystemTask(System::Messages::GoToRunning); } - if (currentApp == Apps::Timer) { + if (currentScreenId == ScreenId::Timer) { lv_disp_trig_activity(nullptr); auto* timer = static_cast(currentScreen.get()); timer->Reset(); } else { - LoadNewScreen(Apps::Timer, DisplayApp::FullRefreshDirections::Up); + LoadNewScreen(ScreenId::Timer, DisplayApp::FullRefreshDirections::Up); } motorController.RunForDuration(35); break; case Messages::AlarmTriggered: - if (currentApp == Apps::Alarm) { + if (currentScreenId == ScreenId::Alarm) { auto* alarm = static_cast(currentScreen.get()); alarm->SetAlerting(); } else { - LoadNewScreen(Apps::Alarm, DisplayApp::FullRefreshDirections::None); + LoadNewScreen(ScreenId::Alarm, DisplayApp::FullRefreshDirections::None); } break; case Messages::ShowPairingKey: - LoadNewScreen(Apps::PassKey, DisplayApp::FullRefreshDirections::Up); + LoadNewScreen(ScreenId::PassKey, DisplayApp::FullRefreshDirections::Up); motorController.RunForDuration(35); break; case Messages::TouchEvent: { @@ -290,16 +290,16 @@ void DisplayApp::Refresh() { } }; if (!currentScreen->OnTouchEvent(gesture)) { - if (currentApp == Apps::Clock) { + if (currentScreenId == ScreenId::Clock) { switch (gesture) { case TouchEvents::SwipeUp: - LoadNewScreen(Apps::Launcher, DisplayApp::FullRefreshDirections::Up); + LoadNewScreen(ScreenId::Launcher, DisplayApp::FullRefreshDirections::Up); break; case TouchEvents::SwipeDown: - LoadNewScreen(Apps::Notifications, DisplayApp::FullRefreshDirections::Down); + LoadNewScreen(ScreenId::Notifications, DisplayApp::FullRefreshDirections::Down); break; case TouchEvents::SwipeRight: - LoadNewScreen(Apps::QuickSettings, DisplayApp::FullRefreshDirections::RightAnim); + LoadNewScreen(ScreenId::QuickSettings, DisplayApp::FullRefreshDirections::RightAnim); break; case TouchEvents::DoubleTap: PushMessageToSystemTask(System::Messages::GoToSleep); @@ -307,7 +307,7 @@ void DisplayApp::Refresh() { default: break; } - } else if (gesture == LoadDirToReturnSwipe(appStackDirections.Top())) { + } else if (gesture == LoadDirToReturnSwipe(stackDirections.Top())) { LoadPreviousScreen(); } } else { @@ -316,7 +316,7 @@ void DisplayApp::Refresh() { } break; case Messages::ButtonPushed: if (!currentScreen->OnButtonPushed()) { - if (currentApp == Apps::Clock) { + if (currentScreenId == ScreenId::Clock) { PushMessageToSystemTask(System::Messages::GoToSleep); } else { LoadPreviousScreen(); @@ -324,30 +324,30 @@ void DisplayApp::Refresh() { } break; case Messages::ButtonLongPressed: - if (currentApp != Apps::Clock) { - if (currentApp == Apps::Notifications) { - LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::Up); - } else if (currentApp == Apps::QuickSettings) { - LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::LeftAnim); + if (currentScreenId != ScreenId::Clock) { + if (currentScreenId == ScreenId::Notifications) { + LoadNewScreen(ScreenId::Clock, DisplayApp::FullRefreshDirections::Up); + } else if (currentScreenId == ScreenId::QuickSettings) { + LoadNewScreen(ScreenId::Clock, DisplayApp::FullRefreshDirections::LeftAnim); } else { - LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::Down); + LoadNewScreen(ScreenId::Clock, DisplayApp::FullRefreshDirections::Down); } - appStackDirections.Reset(); - returnAppStack.Reset(); + stackDirections.Reset(); + returnStack.Reset(); } break; case Messages::ButtonLongerPressed: // Create reboot app and open it instead - LoadNewScreen(Apps::SysInfo, DisplayApp::FullRefreshDirections::Up); + LoadNewScreen(ScreenId::SysInfo, DisplayApp::FullRefreshDirections::Up); break; case Messages::ButtonDoubleClicked: - if (currentApp != Apps::Notifications && currentApp != Apps::NotificationsPreview) { - LoadNewScreen(Apps::Notifications, DisplayApp::FullRefreshDirections::Down); + if (currentScreenId != ScreenId::Notifications && currentScreenId != ScreenId::NotificationsPreview) { + LoadNewScreen(ScreenId::Notifications, DisplayApp::FullRefreshDirections::Down); } break; case Messages::BleFirmwareUpdateStarted: - LoadNewScreen(Apps::FirmwareUpdate, DisplayApp::FullRefreshDirections::Down); + LoadNewScreen(ScreenId::FirmwareUpdate, DisplayApp::FullRefreshDirections::Down); break; case Messages::BleRadioEnableToggle: PushMessageToSystemTask(System::Messages::BleRadioEnableToggle); @@ -357,7 +357,7 @@ void DisplayApp::Refresh() { // What should happen here? break; case Messages::Chime: - LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None); + LoadNewScreen(ScreenId::Clock, DisplayApp::FullRefreshDirections::None); motorController.RunForDuration(35); break; case Messages::OnChargingEvent: @@ -371,29 +371,29 @@ void DisplayApp::Refresh() { currentScreen->OnTouchEvent(touchHandler.GetX(), touchHandler.GetY()); } - if (nextApp != Apps::None) { - LoadNewScreen(nextApp, nextDirection); - nextApp = Apps::None; + if (nextScreenId != ScreenId::None) { + LoadNewScreen(nextScreenId, nextDirection); + nextScreenId = ScreenId::None; } } -void DisplayApp::StartApp(Apps app, DisplayApp::FullRefreshDirections direction) { - nextApp = app; +void DisplayApp::StartApp(ScreenId screenId, DisplayApp::FullRefreshDirections direction) { + nextScreenId = screenId; nextDirection = direction; } -void DisplayApp::LoadNewScreen(Apps app, DisplayApp::FullRefreshDirections direction) { +void DisplayApp::LoadNewScreen(ScreenId screenId, DisplayApp::FullRefreshDirections direction) { // Don't add the same screen to the stack back to back. // This is mainly to fix an issue with receiving two notifications at the same time // and shouldn't happen otherwise. - if (app != currentApp) { - returnAppStack.Push(currentApp); - appStackDirections.Push(direction); + if (screenId != currentScreenId) { + returnStack.Push(currentScreenId); + stackDirections.Push(direction); } - LoadScreen(app, direction); + LoadScreen(screenId, direction); } -void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections direction) { +void DisplayApp::LoadScreen(ScreenId screenId, DisplayApp::FullRefreshDirections direction) { lvgl.CancelTap(); lv_disp_trig_activity(nullptr); motorController.StopRinging(); @@ -401,16 +401,16 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio currentScreen.reset(nullptr); SetFullRefresh(direction); - switch (app) { - case Apps::Launcher: + switch (screenId) { + case ScreenId::Launcher: currentScreen = std::make_unique(this, settingsController, batteryController, bleController, dateTimeController); break; - case Apps::Motion: + case ScreenId::Motion: // currentScreen = std::make_unique(motionController); // break; - case Apps::None: - case Apps::Clock: + case ScreenId::None: + case ScreenId::Clock: currentScreen = std::make_unique(dateTimeController, batteryController, bleController, @@ -422,22 +422,22 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio filesystem); break; - case Apps::Error: + case ScreenId::Error: currentScreen = std::make_unique(bootError); break; - case Apps::FirmwareValidation: + case ScreenId::FirmwareValidation: currentScreen = std::make_unique(validator); break; - case Apps::FirmwareUpdate: + case ScreenId::FirmwareUpdate: currentScreen = std::make_unique(bleController); break; - case Apps::PassKey: + case ScreenId::PassKey: currentScreen = std::make_unique(bleController.GetPairingKey()); break; - case Apps::Notifications: + case ScreenId::Notifications: currentScreen = std::make_unique(this, notificationManager, systemTask->nimble().alertService(), @@ -445,7 +445,7 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio *systemTask, Screens::Notifications::Modes::Normal); break; - case Apps::NotificationsPreview: + case ScreenId::NotificationsPreview: currentScreen = std::make_unique(this, notificationManager, systemTask->nimble().alertService(), @@ -453,15 +453,15 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio *systemTask, Screens::Notifications::Modes::Preview); break; - case Apps::Timer: + case ScreenId::Timer: currentScreen = std::make_unique(timer); break; - case Apps::Alarm: + case ScreenId::Alarm: currentScreen = std::make_unique(alarmController, settingsController.GetClockType(), *systemTask, motorController); break; // Settings - case Apps::QuickSettings: + case ScreenId::QuickSettings: currentScreen = std::make_unique(this, batteryController, dateTimeController, @@ -470,40 +470,40 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio settingsController, bleController); break; - case Apps::Settings: + case ScreenId::Settings: currentScreen = std::make_unique(this, settingsController); break; - case Apps::SettingWatchFace: + case ScreenId::SettingWatchFace: currentScreen = std::make_unique(this, settingsController, filesystem); break; - case Apps::SettingTimeFormat: + case ScreenId::SettingTimeFormat: currentScreen = std::make_unique(settingsController); break; - case Apps::SettingWakeUp: + case ScreenId::SettingWakeUp: currentScreen = std::make_unique(settingsController); break; - case Apps::SettingDisplay: + case ScreenId::SettingDisplay: currentScreen = std::make_unique(this, settingsController); break; - case Apps::SettingSteps: + case ScreenId::SettingSteps: currentScreen = std::make_unique(settingsController); break; - case Apps::SettingSetDateTime: + case ScreenId::SettingSetDateTime: currentScreen = std::make_unique(this, dateTimeController, settingsController); break; - case Apps::SettingChimes: + case ScreenId::SettingChimes: currentScreen = std::make_unique(settingsController); break; - case Apps::SettingShakeThreshold: + case ScreenId::SettingShakeThreshold: currentScreen = std::make_unique(settingsController, motionController, *systemTask); break; - case Apps::SettingBluetooth: + case ScreenId::SettingBluetooth: currentScreen = std::make_unique(this, settingsController); break; - case Apps::BatteryInfo: + case ScreenId::BatteryInfo: currentScreen = std::make_unique(batteryController); break; - case Apps::SysInfo: + case ScreenId::SysInfo: currentScreen = std::make_unique(this, dateTimeController, batteryController, @@ -513,43 +513,43 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio motionController, touchPanel); break; - case Apps::FlashLight: + case ScreenId::FlashLight: currentScreen = std::make_unique(*systemTask, brightnessController); break; - case Apps::StopWatch: + case ScreenId::StopWatch: currentScreen = std::make_unique(*systemTask); break; - case Apps::Twos: + case ScreenId::Twos: currentScreen = std::make_unique(); break; - case Apps::Paint: + case ScreenId::Paint: currentScreen = std::make_unique(lvgl, motorController); break; - case Apps::Paddle: + case ScreenId::Paddle: currentScreen = std::make_unique(lvgl); break; - case Apps::Music: + case ScreenId::Music: currentScreen = std::make_unique(systemTask->nimble().music()); break; - case Apps::Navigation: + case ScreenId::Navigation: currentScreen = std::make_unique(systemTask->nimble().navigation()); break; - case Apps::HeartRate: + case ScreenId::HeartRate: currentScreen = std::make_unique(heartRateController, *systemTask); break; - case Apps::Metronome: + case ScreenId::Metronome: currentScreen = std::make_unique(motorController, *systemTask); break; /* Weather debug app - case Apps::Weather: + case ScreenId::Weather: currentScreen = std::make_unique(this, systemTask->nimble().weather()); break; */ - case Apps::Steps: + case ScreenId::Steps: currentScreen = std::make_unique(motionController, settingsController); break; } - currentApp = app; + currentScreenId = screenId; } void DisplayApp::PushMessage(Messages msg) { diff --git a/src/displayapp/DisplayApp.h b/src/displayapp/DisplayApp.h index f537651dbf..69f32b026a 100644 --- a/src/displayapp/DisplayApp.h +++ b/src/displayapp/DisplayApp.h @@ -4,7 +4,6 @@ #include #include #include -#include "displayapp/Apps.h" #include "displayapp/LittleVgl.h" #include "displayapp/TouchEvents.h" #include "components/brightness/BrightnessController.h" @@ -13,6 +12,7 @@ #include "components/settings/Settings.h" #include "displayapp/screens/Screen.h" #include "components/timer/Timer.h" +#include "displayapp/ScreenIds.h" #include "components/alarm/AlarmController.h" #include "touchhandler/TouchHandler.h" @@ -68,7 +68,7 @@ namespace Pinetime { void Start(System::BootErrors error); void PushMessage(Display::Messages msg); - void StartApp(Apps app, DisplayApp::FullRefreshDirections direction); + void StartApp(ScreenId screenId, DisplayApp::FullRefreshDirections direction); void SetFullRefresh(FullRefreshDirections direction); @@ -106,8 +106,8 @@ namespace Pinetime { std::unique_ptr currentScreen; - Apps currentApp = Apps::None; - Apps returnToApp = Apps::None; + ScreenId currentScreenId = ScreenId::None; + ScreenId returnToScreenId = ScreenId::None; FullRefreshDirections returnDirection = FullRefreshDirections::None; TouchEvents returnTouchEvent = TouchEvents::None; @@ -115,18 +115,18 @@ namespace Pinetime { static void Process(void* instance); void InitHw(); void Refresh(); - void LoadNewScreen(Apps app, DisplayApp::FullRefreshDirections direction); - void LoadScreen(Apps app, DisplayApp::FullRefreshDirections direction); + void LoadNewScreen(ScreenId screenId, DisplayApp::FullRefreshDirections direction); + void LoadScreen(ScreenId screenId, DisplayApp::FullRefreshDirections direction); void PushMessageToSystemTask(Pinetime::System::Messages message); - Apps nextApp = Apps::None; + ScreenId nextScreenId = ScreenId::None; DisplayApp::FullRefreshDirections nextDirection; System::BootErrors bootError; void ApplyBrightness(); - static constexpr size_t returnAppStackSize = 10; - Utility::StaticStack returnAppStack; - Utility::StaticStack appStackDirections; + static constexpr size_t returnStackSize = 10; + Utility::StaticStack returnStack; + Utility::StaticStack stackDirections; bool isDimmed = false; }; diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h index 3ce9518773..6091d2a632 100644 --- a/src/displayapp/DisplayAppRecovery.h +++ b/src/displayapp/DisplayAppRecovery.h @@ -11,7 +11,6 @@ #include #include "BootErrors.h" #include "displayapp/TouchEvents.h" -#include "displayapp/Apps.h" #include "displayapp/Messages.h" namespace Pinetime { diff --git a/src/displayapp/Apps.h b/src/displayapp/ScreenIds.h similarity index 96% rename from src/displayapp/Apps.h rename to src/displayapp/ScreenIds.h index f253bc0387..e3bb29d746 100644 --- a/src/displayapp/Apps.h +++ b/src/displayapp/ScreenIds.h @@ -2,7 +2,7 @@ namespace Pinetime { namespace Applications { - enum class Apps { + enum class ScreenId { None, Launcher, Clock, diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index 0a65a5d472..402c26d1cc 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -1,7 +1,6 @@ #include "displayapp/screens/ApplicationList.h" #include #include -#include "displayapp/Apps.h" #include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/ApplicationList.h b/src/displayapp/screens/ApplicationList.h index 7bdd115408..4db52c8643 100644 --- a/src/displayapp/screens/ApplicationList.h +++ b/src/displayapp/screens/ApplicationList.h @@ -3,6 +3,7 @@ #include #include +#include "displayapp/ScreenIds.h" #include "displayapp/screens/Screen.h" #include "displayapp/screens/ScreenList.h" #include "components/datetime/DateTimeController.h" @@ -40,21 +41,21 @@ namespace Pinetime { static constexpr int nScreens = 2; static constexpr std::array applications {{ - {Symbols::stopWatch, Apps::StopWatch}, - {Symbols::clock, Apps::Alarm}, - {Symbols::hourGlass, Apps::Timer}, - {Symbols::shoe, Apps::Steps}, - {Symbols::heartBeat, Apps::HeartRate}, - {Symbols::music, Apps::Music}, - - {Symbols::paintbrush, Apps::Paint}, - {Symbols::paddle, Apps::Paddle}, - {"2", Apps::Twos}, - {Symbols::drum, Apps::Metronome}, - {Symbols::map, Apps::Navigation}, - {Symbols::none, Apps::None}, - - // {"M", Apps::Motion}, + {Symbols::stopWatch, ScreenId::StopWatch}, + {Symbols::clock, ScreenId::Alarm}, + {Symbols::hourGlass, ScreenId::Timer}, + {Symbols::shoe, ScreenId::Steps}, + {Symbols::heartBeat, ScreenId::HeartRate}, + {Symbols::music, ScreenId::Music}, + + {Symbols::paintbrush, ScreenId::Paint}, + {Symbols::paddle, ScreenId::Paddle}, + {"2", ScreenId::Twos}, + {Symbols::drum, ScreenId::Metronome}, + {Symbols::map, ScreenId::Navigation}, + {Symbols::none, ScreenId::None}, + + // {"M", ScreenId::Motion}, }}; ScreenList screens; }; diff --git a/src/displayapp/screens/CheckboxList.h b/src/displayapp/screens/CheckboxList.h index c208bc489d..7530f72435 100644 --- a/src/displayapp/screens/CheckboxList.h +++ b/src/displayapp/screens/CheckboxList.h @@ -1,6 +1,5 @@ #pragma once -#include "displayapp/Apps.h" #include "displayapp/screens/Screen.h" #include #include diff --git a/src/displayapp/screens/List.cpp b/src/displayapp/screens/List.cpp index 264b4fc98b..f9f2e99e62 100644 --- a/src/displayapp/screens/List.cpp +++ b/src/displayapp/screens/List.cpp @@ -40,7 +40,7 @@ List::List(uint8_t screenID, for (int i = 0; i < MAXLISTITEMS; i++) { apps[i] = applications[i].application; - if (applications[i].application != Apps::None) { + if (applications[i].application != ScreenId::None) { static constexpr int btnHeight = (LV_HOR_RES_MAX - ((MAXLISTITEMS - 1) * innerPad)) / MAXLISTITEMS; itemApps[i] = lv_btn_create(container, nullptr); @@ -75,7 +75,7 @@ List::~List() { void List::OnButtonEvent(lv_obj_t* object, lv_event_t event) { if (event == LV_EVENT_CLICKED) { for (int i = 0; i < MAXLISTITEMS; i++) { - if (apps[i] != Apps::None && object == itemApps[i]) { + if (apps[i] != ScreenId::None && object == itemApps[i]) { app->StartApp(apps[i], DisplayApp::FullRefreshDirections::Up); running = false; return; diff --git a/src/displayapp/screens/List.h b/src/displayapp/screens/List.h index 564229e694..71a6335c31 100644 --- a/src/displayapp/screens/List.h +++ b/src/displayapp/screens/List.h @@ -5,7 +5,7 @@ #include #include "displayapp/screens/Screen.h" #include "displayapp/widgets/PageIndicator.h" -#include "displayapp/Apps.h" +#include "displayapp/ScreenIds.h" #include "components/settings/Settings.h" #define MAXLISTITEMS 4 @@ -18,7 +18,7 @@ namespace Pinetime { struct Applications { const char* icon; const char* name; - Pinetime::Applications::Apps application; + Pinetime::Applications::ScreenId application; }; explicit List(uint8_t screenID, @@ -33,7 +33,7 @@ namespace Pinetime { private: DisplayApp* app; Controllers::Settings& settingsController; - Pinetime::Applications::Apps apps[MAXLISTITEMS]; + Pinetime::Applications::ScreenId apps[MAXLISTITEMS]; lv_obj_t* itemApps[MAXLISTITEMS]; diff --git a/src/displayapp/screens/Tile.cpp b/src/displayapp/screens/Tile.cpp index 1266f379f8..9a800d59c5 100644 --- a/src/displayapp/screens/Tile.cpp +++ b/src/displayapp/screens/Tile.cpp @@ -51,7 +51,7 @@ Tile::Tile(uint8_t screenID, if (i == 3) { btnmMap[btIndex++] = "\n"; } - if (applications[i].application == Apps::None) { + if (applications[i].application == ScreenId::None) { btnmMap[btIndex] = " "; } else { btnmMap[btIndex] = applications[i].icon; @@ -76,7 +76,7 @@ Tile::Tile(uint8_t screenID, for (uint8_t i = 0; i < 6; i++) { lv_btnmatrix_set_btn_ctrl(btnm1, i, LV_BTNMATRIX_CTRL_CLICK_TRIG); - if (applications[i].application == Apps::None) { + if (applications[i].application == ScreenId::None) { lv_btnmatrix_set_btn_ctrl(btnm1, i, LV_BTNMATRIX_CTRL_DISABLED); } } diff --git a/src/displayapp/screens/Tile.h b/src/displayapp/screens/Tile.h index 91acb26c7b..f72ad8c259 100644 --- a/src/displayapp/screens/Tile.h +++ b/src/displayapp/screens/Tile.h @@ -4,7 +4,7 @@ #include #include #include "displayapp/screens/Screen.h" -#include "displayapp/Apps.h" +#include "displayapp/ScreenIds.h" #include "components/datetime/DateTimeController.h" #include "components/settings/Settings.h" #include "components/battery/BatteryController.h" @@ -18,7 +18,7 @@ namespace Pinetime { public: struct Applications { const char* icon; - Pinetime::Applications::Apps application; + Pinetime::Applications::ScreenId application; }; explicit Tile(uint8_t screenID, @@ -48,7 +48,7 @@ namespace Pinetime { Widgets::StatusIcons statusIcons; const char* btnmMap[8]; - Pinetime::Applications::Apps apps[6]; + Pinetime::Applications::ScreenId apps[6]; }; } } diff --git a/src/displayapp/screens/settings/QuickSettings.cpp b/src/displayapp/screens/settings/QuickSettings.cpp index 0548488855..9ba3b2e26c 100644 --- a/src/displayapp/screens/settings/QuickSettings.cpp +++ b/src/displayapp/screens/settings/QuickSettings.cpp @@ -4,6 +4,7 @@ #include "displayapp/screens/BatteryIcon.h" #include "components/ble/BleController.h" #include "displayapp/InfiniTimeTheme.h" +#include "displayapp/ScreenIds.h" using namespace Pinetime::Applications::Screens; @@ -137,7 +138,7 @@ void QuickSettings::UpdateScreen() { void QuickSettings::OnButtonEvent(lv_obj_t* object) { if (object == btn2) { - app->StartApp(Apps::FlashLight, DisplayApp::FullRefreshDirections::Up); + app->StartApp(ScreenId::FlashLight, DisplayApp::FullRefreshDirections::Up); } else if (object == btn1) { brightness.Step(); @@ -163,6 +164,6 @@ void QuickSettings::OnButtonEvent(lv_obj_t* object) { } else if (object == btn4) { settingsController.SetSettingsMenu(0); - app->StartApp(Apps::Settings, DisplayApp::FullRefreshDirections::Up); + app->StartApp(ScreenId::Settings, DisplayApp::FullRefreshDirections::Up); } } diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp index 065417fa7c..d959ea7959 100644 --- a/src/displayapp/screens/settings/Settings.cpp +++ b/src/displayapp/screens/settings/Settings.cpp @@ -1,7 +1,6 @@ #include "displayapp/screens/settings/Settings.h" #include #include -#include "displayapp/Apps.h" #include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/settings/Settings.h b/src/displayapp/screens/settings/Settings.h index 3f8097538e..f16216f838 100644 --- a/src/displayapp/screens/settings/Settings.h +++ b/src/displayapp/screens/settings/Settings.h @@ -2,6 +2,7 @@ #include #include +#include "displayapp/ScreenIds.h" #include "displayapp/screens/Screen.h" #include "displayapp/screens/ScreenList.h" #include "displayapp/screens/Symbols.h" @@ -32,25 +33,25 @@ namespace Pinetime { static constexpr int nScreens = 3; static constexpr std::array entries {{ - {Symbols::sun, "Display", Apps::SettingDisplay}, - {Symbols::eye, "Wake Up", Apps::SettingWakeUp}, - {Symbols::clock, "Time format", Apps::SettingTimeFormat}, - {Symbols::home, "Watch face", Apps::SettingWatchFace}, - - {Symbols::shoe, "Steps", Apps::SettingSteps}, - {Symbols::clock, "Date&Time", Apps::SettingSetDateTime}, - {Symbols::batteryHalf, "Battery", Apps::BatteryInfo}, - {Symbols::clock, "Chimes", Apps::SettingChimes}, - - {Symbols::tachometer, "Shake Calib.", Apps::SettingShakeThreshold}, - {Symbols::check, "Firmware", Apps::FirmwareValidation}, - {Symbols::bluetooth, "Bluetooth", Apps::SettingBluetooth}, - {Symbols::list, "About", Apps::SysInfo}, - - // {Symbols::none, "None", Apps::None}, - // {Symbols::none, "None", Apps::None}, - // {Symbols::none, "None", Apps::None}, - // {Symbols::none, "None", Apps::None}, + {Symbols::sun, "Display", ScreenId::SettingDisplay}, + {Symbols::eye, "Wake Up", ScreenId::SettingWakeUp}, + {Symbols::clock, "Time format", ScreenId::SettingTimeFormat}, + {Symbols::home, "Watch face", ScreenId::SettingWatchFace}, + + {Symbols::shoe, "Steps", ScreenId::SettingSteps}, + {Symbols::clock, "Date&Time", ScreenId::SettingSetDateTime}, + {Symbols::batteryHalf, "Battery", ScreenId::BatteryInfo}, + {Symbols::clock, "Chimes", ScreenId::SettingChimes}, + + {Symbols::tachometer, "Shake Calib.", ScreenId::SettingShakeThreshold}, + {Symbols::check, "Firmware", ScreenId::FirmwareValidation}, + {Symbols::bluetooth, "Bluetooth", ScreenId::SettingBluetooth}, + {Symbols::list, "About", ScreenId::SysInfo}, + + // {Symbols::none, "None", ScreenId::None}, + // {Symbols::none, "None", ScreenId::None}, + // {Symbols::none, "None", ScreenId::None}, + // {Symbols::none, "None", ScreenId::None}, }}; ScreenList screens;