diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2022-05-20 08:55:40 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-06-07 03:01:47 (GMT) |
| commit | d4224e1ce2f6825f07e23a0b1ec1963bfa03f37c (patch) | |
| tree | 205372acb7abb84efe19361e27faf5f88a982803 /src/displayapp/screens/settings/Settings.h | |
| parent | 6f169f67a2e7fe926092655cb68e7672b61bd8e3 (diff) | |
Automatically create enough screens for all apps and settings
Diffstat (limited to 'src/displayapp/screens/settings/Settings.h')
| -rw-r--r-- | src/displayapp/screens/settings/Settings.h | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/src/displayapp/screens/settings/Settings.h b/src/displayapp/screens/settings/Settings.h index be09007..4ef507a 100644 --- a/src/displayapp/screens/settings/Settings.h +++ b/src/displayapp/screens/settings/Settings.h @@ -3,6 +3,8 @@ #include <cstdint> #include "displayapp/screens/Screen.h" #include "displayapp/screens/ScreenList.h" +#include "displayapp/screens/Symbols.h" +#include "displayapp/screens/List.h" namespace Pinetime { @@ -17,14 +19,34 @@ namespace Pinetime { bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override; private: - Controllers::Settings& settingsController; + auto CreateScreenList() const; + std::unique_ptr<Screen> CreateScreen(unsigned int screenNum) const; - ScreenList<4> screens; + Controllers::Settings& settingsController; - std::unique_ptr<Screen> CreateScreen1(); - std::unique_ptr<Screen> CreateScreen2(); - std::unique_ptr<Screen> CreateScreen3(); - std::unique_ptr<Screen> CreateScreen4(); + static constexpr std::array<List::Applications, 16> 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, "Set date", Apps::SettingSetDate}, + {Symbols::clock, "Set time", Apps::SettingSetTime}, + {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}, + }}; + static constexpr int nScreens = (entries.size() + 3) / 4; + ScreenList<nScreens> screens; }; } } |
