From bb11891b6e66efdc0a0fc8a9761d94719fd4748f Mon Sep 17 00:00:00 2001 From: JF Date: Fri, 3 Jul 2020 21:37:40 +0200 Subject: Remove custom styles in Screens and define default style and "Big style" in LittleVgl during the initialization of LVGL. --- src/DisplayApp/Screens/Clock.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/DisplayApp/Screens/Clock.cpp') 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(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_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); -- cgit v1.2.3