1
0
Fork 0
InfiniTime/src/displayapp/screens/settings/SettingWatchFace.h

56 lines
1.7 KiB
C
Raw Normal View History

#pragma once
2021-09-20 15:13:46 +03:00
#include <array>
#include <cstdint>
#include <lvgl/lvgl.h>
2022-03-06 13:32:06 +01:00
#include "displayapp/screens/ScreenList.h"
2021-12-03 21:39:18 +02:00
#include "components/settings/Settings.h"
#include "displayapp/screens/Screen.h"
2022-03-06 13:32:06 +01:00
#include "displayapp/screens/Symbols.h"
2022-10-13 21:24:58 +03:00
#include "displayapp/screens/CheckboxList.h"
#include "displayapp/screens/WatchFaceInfineat.h"
#include "displayapp/screens/WatchFaceCasioStyleG7710.h"
2021-12-03 21:39:18 +02:00
namespace Pinetime {
namespace Applications {
namespace Screens {
class SettingWatchFace : public Screen {
2021-04-24 12:00:45 +03:00
public:
struct Item {
const char* name;
WatchFace watchface;
bool enabled;
};
SettingWatchFace(DisplayApp* app,
std::array<Item, UserWatchFaceTypes::Count>&& watchfaceItems,
Pinetime::Controllers::Settings& settingsController,
Pinetime::Controllers::FS& filesystem);
~SettingWatchFace() override;
2022-03-06 13:32:06 +01:00
bool OnTouchEvent(TouchEvents event) override;
2021-04-24 12:00:45 +03:00
private:
DisplayApp* app;
2022-10-13 21:24:58 +03:00
auto CreateScreenList() const;
std::unique_ptr<Screen> CreateScreen(unsigned int screenNum) const;
static constexpr int settingsPerScreen = 4;
std::array<Item, UserWatchFaceTypes::Count> watchfaceItems;
static constexpr int nScreens = UserWatchFaceTypes::Count > 0 ? (UserWatchFaceTypes ::Count - 1) / settingsPerScreen + 1 : 1;
Controllers::Settings& settingsController;
Pinetime::Controllers::FS& filesystem;
2021-09-20 15:13:46 +03:00
2022-03-06 13:32:06 +01:00
static constexpr const char* title = "Watch face";
static constexpr const char* symbol = Symbols::home;
2022-10-13 21:24:58 +03:00
ScreenList<nScreens> screens;
};
}
}
}