From f5328ec9eb9d55423b4e511910721d839cacadd8 Mon Sep 17 00:00:00 2001 From: JF Date: Fri, 14 Aug 2020 09:46:37 +0200 Subject: Refactor ScreenList to make it more generic : it can now contain any Screen type. Integrate this new ScreenList in SystemInfo. Add ApplicationList, which is a ScreenList of Tile. This allows to display a menu of more than 6 applications. --- src/DisplayApp/Screens/Tile.h | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) (limited to 'src/DisplayApp/Screens/Tile.h') diff --git a/src/DisplayApp/Screens/Tile.h b/src/DisplayApp/Screens/Tile.h index a04b58a8..3136d892 100644 --- a/src/DisplayApp/Screens/Tile.h +++ b/src/DisplayApp/Screens/Tile.h @@ -5,13 +5,19 @@ #include #include "Modal.h" #include +#include namespace Pinetime { namespace Applications { namespace Screens { class Tile : public Screen { public: - explicit Tile(DisplayApp* app); + struct Applications { + const char* icon; + Pinetime::Applications::Apps application; + }; + + explicit Tile(DisplayApp* app, std::array& applications); ~Tile() override; bool Refresh() override; @@ -20,40 +26,13 @@ namespace Pinetime { void OnObjectEvent(lv_obj_t* obj, lv_event_t event, uint32_t buttonId); private: - - lv_style_t* labelRelStyle; - lv_style_t* labelPrStyle; - lv_obj_t * label1; - lv_obj_t * label2; - lv_obj_t * label3; - - lv_obj_t* backgroundLabel; - lv_obj_t * button; - lv_obj_t * labelClick; - - lv_obj_t *tileview; - lv_obj_t * tile1; - lv_obj_t * tile2; - lv_obj_t * list; - lv_obj_t * list_btn; - lv_obj_t * tile3; - lv_obj_t * btn1; - lv_obj_t * btn2; - lv_obj_t * btn3; - lv_obj_t * btnm1; - lv_obj_t * btnm2; - - uint32_t clickCount = 0 ; - uint32_t previousClickCount = 0; - void StartClockApp(); - void StartSysInfoApp(); - void StartMeterApp(); - void StartGaugeApp(); bool running = true; std::unique_ptr modal; - void StartBrightnessApp(); + + const char* btnm_map1[8]; + Pinetime::Applications::Apps apps[6]; }; } } -- cgit v1.2.3-70-g09d2