
In the screens that use `DisplayApp *app` and pass it to a child item, or use the reference just in the constructor. Afterwards the `app` member is not used. So remove it from the private member variables. Completely remove `app` parameter from `SettingDisplay` constructor as it is unused.
55 lines
1.6 KiB
C++
55 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <lvgl/lvgl.h>
|
|
|
|
#include "displayapp/screens/ScreenList.h"
|
|
#include "components/settings/Settings.h"
|
|
#include "displayapp/screens/Screen.h"
|
|
#include "displayapp/screens/Symbols.h"
|
|
#include "displayapp/screens/CheckboxList.h"
|
|
#include "displayapp/screens/WatchFaceInfineat.h"
|
|
#include "displayapp/screens/WatchFaceCasioStyleG7710.h"
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Applications {
|
|
namespace Screens {
|
|
|
|
class SettingWatchFace : public Screen {
|
|
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;
|
|
|
|
bool OnTouchEvent(TouchEvents event) override;
|
|
|
|
private:
|
|
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;
|
|
|
|
static constexpr const char* title = "Watch face";
|
|
static constexpr const char* symbol = Symbols::home;
|
|
|
|
ScreenList<nScreens> screens;
|
|
};
|
|
}
|
|
}
|
|
}
|