diff options
author | JF <jf@codingfield.com> | 2020-07-03 21:37:40 +0200 |
---|---|---|
committer | JF <jf@codingfield.com> | 2020-07-03 21:37:40 +0200 |
commit | bb11891b6e66efdc0a0fc8a9761d94719fd4748f (patch) | |
tree | e11e953522ef9f4370b44f8a415d2cc597ef9383 /src/DisplayApp/Screens/Clock.cpp | |
parent | ca549bcfd86ea3426a74292abbe2e4bd1303cb75 (diff) |
Remove custom styles in Screens and define default style and "Big style" in LittleVgl during the initialization of LVGL.
Diffstat (limited to 'src/DisplayApp/Screens/Clock.cpp')
-rw-r--r-- | src/DisplayApp/Screens/Clock.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/DisplayApp/Screens/Clock.cpp b/src/DisplayApp/Screens/Clock.cpp index 07db83ee..68471854 100644 --- a/src/DisplayApp/Screens/Clock.cpp +++ b/src/DisplayApp/Screens/Clock.cpp @@ -11,7 +11,7 @@ using namespace Pinetime::Applications::Screens; extern lv_font_t jetbrains_mono_extrabold_compressed; extern lv_font_t jetbrains_mono_bold_20; - +extern lv_style_t* LabelBigStyle; static void event_handler(lv_obj_t * obj, lv_event_t event) { Clock* screen = static_cast<Clock *>(obj->user_data); @@ -41,21 +41,12 @@ Clock::Clock(DisplayApp* app, lv_obj_align(label_date, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 60); - labelStyle = const_cast<lv_style_t *>(lv_label_get_style(label_date, LV_LABEL_STYLE_MAIN)); - labelStyle->text.font = &jetbrains_mono_bold_20; - - lv_style_copy(&labelBigStyle, labelStyle); - labelBigStyle.text.font = &jetbrains_mono_extrabold_compressed; - - lv_label_set_style(label_date, LV_LABEL_STYLE_MAIN, labelStyle); - label_time = lv_label_create(lv_scr_act(), NULL); - lv_label_set_style(label_time, LV_LABEL_STYLE_MAIN, &labelBigStyle); + lv_label_set_style(label_time, LV_LABEL_STYLE_MAIN, LabelBigStyle); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 0); backgroundLabel = lv_label_create(lv_scr_act(), NULL); backgroundLabel->user_data = this; - lv_label_set_style(backgroundLabel, LV_LABEL_STYLE_MAIN, labelStyle); lv_obj_set_click(backgroundLabel, true); lv_obj_set_event_cb(backgroundLabel, event_handler); lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP); |