diff options
| author | JF <jf@codingfield.com> | 2020-08-14 07:46:37 (GMT) |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-08-14 07:46:37 (GMT) |
| commit | f5328ec9eb9d55423b4e511910721d839cacadd8 (patch) | |
| tree | 8cbc6faf0c87dca43fb33e0dcdaa6ea1e64d0b05 /src/DisplayApp/Screens/Label.h | |
| parent | 27fa273d8315f972931dba7971a99b0fbba7360e (diff) | |
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.
Diffstat (limited to 'src/DisplayApp/Screens/Label.h')
| -rw-r--r-- | src/DisplayApp/Screens/Label.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/DisplayApp/Screens/Label.h b/src/DisplayApp/Screens/Label.h index b73540f..9d91974 100644 --- a/src/DisplayApp/Screens/Label.h +++ b/src/DisplayApp/Screens/Label.h @@ -2,6 +2,7 @@ #include <vector> #include "Screen.h" +#include <lvgl/lvgl.h> namespace Pinetime { namespace Applications { @@ -19,6 +20,26 @@ namespace Pinetime { lv_obj_t * label = nullptr; const char* text = nullptr; }; + + class Label2 : public Screen { + public: + Label2(DisplayApp* app, const char* text) : Screen(app), text{text} { + label = lv_label_create(lv_scr_act(), NULL); + lv_label_set_align(label, LV_LABEL_ALIGN_LEFT); + lv_obj_set_size(label, 240, 240); + lv_label_set_text(label, text); + } + + ~Label2() override { + lv_obj_clean(lv_scr_act()); + } + + bool Refresh() override {return false;} + + private: + lv_obj_t * label = nullptr; + const char* text = nullptr; + }; } } }
\ No newline at end of file |
