aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp/screens/settings/SettingWatchFace.h
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2023-12-24 11:44:37 +0100
committerJF <JF002@users.noreply.github.com>2024-01-06 14:44:10 +0100
commit22f6d4a40b6715b436f5eb3bf8524fa955eccd20 (patch)
tree71f344d3187b6b3d92712ab1d0a3440a1220c9b9 /src/displayapp/screens/settings/SettingWatchFace.h
parent12acef6a71602c1f8425202560209355da1ce97b (diff)
Watch face selection using CMake
The list of watch face to build into the firmware is now set by CMake (-DENABLE_WATCHFACES). Fix SettingWatchFace : convert to index to/from WatchFace when needed.
Diffstat (limited to 'src/displayapp/screens/settings/SettingWatchFace.h')
-rw-r--r--src/displayapp/screens/settings/SettingWatchFace.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/displayapp/screens/settings/SettingWatchFace.h b/src/displayapp/screens/settings/SettingWatchFace.h
index 66559c73..4c75b0ab 100644
--- a/src/displayapp/screens/settings/SettingWatchFace.h
+++ b/src/displayapp/screens/settings/SettingWatchFace.h
@@ -19,8 +19,14 @@ namespace Pinetime {
class SettingWatchFace : public Screen {
public:
+ struct Item {
+ const char* name;
+ WatchFace watchface;
+ bool enabled;
+ };
+
SettingWatchFace(DisplayApp* app,
- std::array<Screens::CheckboxList::Item, UserWatchFaceTypes::Count>&& watchfaceItems,
+ std::array<Item, UserWatchFaceTypes::Count>&& watchfaceItems,
Pinetime::Controllers::Settings& settingsController,
Pinetime::Controllers::FS& filesystem);
~SettingWatchFace() override;
@@ -33,7 +39,7 @@ namespace Pinetime {
std::unique_ptr<Screen> CreateScreen(unsigned int screenNum) const;
static constexpr int settingsPerScreen = 4;
- std::array<Screens::CheckboxList::Item, UserWatchFaceTypes::Count> watchfaceItems;
+ std::array<Item, UserWatchFaceTypes::Count> watchfaceItems;
static constexpr int nScreens = UserWatchFaceTypes::Count > 0 ? (UserWatchFaceTypes ::Count - 1) / settingsPerScreen + 1 : 1;
Controllers::Settings& settingsController;