aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp/screens/ScreenList.h
diff options
context:
space:
mode:
authorhassless <85612141+hassless@users.noreply.github.com>2021-06-18 17:17:26 +0200
committerGitHub <noreply@github.com>2021-06-18 17:17:26 +0200
commit84a6c88e98d8b1420edbddd7b67a38737bf5cbb2 (patch)
treeb10cab7ef1a7645fa897aabb179c2e8849a919d7 /src/displayapp/screens/ScreenList.h
parentd0df278b0be2aae0493d901569a094dba221ce99 (diff)
parente90e8c7426f9a44e696b208a5b393a60476a3d43 (diff)
Merge branch 'JF002:develop' into improve-battery-percentage-to-battery-icon-mapping
Diffstat (limited to 'src/displayapp/screens/ScreenList.h')
-rw-r--r--src/displayapp/screens/ScreenList.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/displayapp/screens/ScreenList.h b/src/displayapp/screens/ScreenList.h
index 73ea4610..ea66bfb2 100644
--- a/src/displayapp/screens/ScreenList.h
+++ b/src/displayapp/screens/ScreenList.h
@@ -15,12 +15,17 @@ namespace Pinetime {
public:
ScreenList(DisplayApp* app,
uint8_t initScreen,
- std::array<std::function<std::unique_ptr<Screen>()>, N>&& screens,
+ const std::array<std::function<std::unique_ptr<Screen>()>, N>&& screens,
ScreenListModes mode)
- : Screen(app), initScreen {initScreen}, screens {std::move(screens)}, mode {mode}, current {this->screens[initScreen]()} {
- screenIndex = initScreen;
+ : Screen(app), initScreen {initScreen}, screens {std::move(screens)}, mode {mode}, screenIndex{initScreen}, current {this->screens[initScreen]()} {
+
}
+ ScreenList(const ScreenList&) = delete;
+ ScreenList& operator=(const ScreenList&) = delete;
+ ScreenList(ScreenList&&) = delete;
+ ScreenList& operator=(ScreenList&&) = delete;
+
~ScreenList() override {
lv_obj_clean(lv_scr_act());
}
@@ -97,7 +102,7 @@ namespace Pinetime {
private:
uint8_t initScreen = 0;
- std::array<std::function<std::unique_ptr<Screen>()>, N> screens;
+ const std::array<std::function<std::unique_ptr<Screen>()>, N> screens;
ScreenListModes mode = ScreenListModes::UpDown;
uint8_t screenIndex = 0;