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-07 03:20:51 (GMT) |
| commit | 8b322a66a7dc9572a9a2e13b615fdd60b054f8e9 (patch) | |
| tree | 3df311293ae455428b74daa35c99eabfb92714a1 /src/displayapp/screens/ApplicationList.cpp | |
| parent | 984316be128d98aa042a7a5f96aa30cc2637b3e5 (diff) | |
Preallocate blocks for tiled multi-screen menus (requires C++17)
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]); } |
