diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-06-03 10:23:25 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-06-04 17:55:05 (GMT) |
| commit | 84f0c705e8cf4cd0823bbd86a31b43fc3a061e6d (patch) | |
| tree | 429d315b9ffeee417a1390fa0fb35d1153bab5c4 /src/displayapp/screens/ApplicationList.cpp | |
| parent | 3d3a0a1c4ba134d6ece47e24492685bb7d64465b (diff) | |
Use C++17 and preallocate blocks for tiled multi-screen menus
Diffstat (limited to 'src/displayapp/screens/ApplicationList.cpp')
| -rw-r--r-- | src/displayapp/screens/ApplicationList.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index 5284433..0de5b54 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -6,7 +6,6 @@ using namespace Pinetime::Applications::Screens; -constexpr std::array<Tile::Applications, ApplicationList::applications.size()> ApplicationList::applications; auto ApplicationList::CreateScreenList() const { std::array<std::function<std::unique_ptr<Screen>()>, nScreens> screens; @@ -38,11 +37,6 @@ bool ApplicationList::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } std::unique_ptr<Screen> ApplicationList::CreateScreen(unsigned int screenNum) const { - std::array<Tile::Applications, appsPerScreen> apps; - for (int i = 0; i < appsPerScreen; i++) { - apps[i] = applications[screenNum * appsPerScreen + i]; - } - - return std::make_unique<Screens::Tile>(screenNum, nScreens, app, settingsController, batteryController, dateTimeController, apps); + return std::make_unique<Screens::Tile>(screenNum, nScreens, app, settingsController, batteryController, dateTimeController, applications[screenNum]); } |
