diff --git a/radio/src/gui/colorlcd/LvglWrapper.cpp b/radio/src/gui/colorlcd/LvglWrapper.cpp index a5ae755a2..ec5b19b6d 100644 --- a/radio/src/gui/colorlcd/LvglWrapper.cpp +++ b/radio/src/gui/colorlcd/LvglWrapper.cpp @@ -254,10 +254,13 @@ static lv_style_t btn_style; static lv_style_t btn_checked_style; static lv_style_t btn_focused_style; static lv_style_t btn_checked_focused_style; +static lv_style_t menu_line_style; +static lv_style_t menu_focused_style; static void theme_apply_cb(lv_theme_t * th, lv_obj_t * obj) { LV_UNUSED(th); + lv_obj_add_style(obj, &generic_style, LV_PART_MAIN); lv_obj_t* parent = lv_obj_get_parent(obj); @@ -272,6 +275,14 @@ static void theme_apply_cb(lv_theme_t * th, lv_obj_t * obj) lv_obj_add_style(obj, &btn_focused_style, LV_STATE_FOCUSED); return; } + + if (lv_obj_check_type(obj, &lv_list_btn_class)) { + // menu items do not use the generic style + lv_obj_remove_style(obj, &generic_style, LV_PART_MAIN); + lv_obj_add_style(obj, &menu_line_style, 0); + lv_obj_add_style(obj, &menu_focused_style, LV_STATE_FOCUSED); + return; + } } static void init_theme() @@ -291,14 +302,27 @@ static void init_theme() lv_style_set_bg_color(&btn_style, makeLvColor(COLOR_THEME_SECONDARY2)); // LV_STATE_CHECKED + lv_style_init(&btn_checked_style); lv_style_set_bg_color(&btn_checked_style, makeLvColor(COLOR_THEME_ACTIVE)); // LV_STATE_FOCUSED + lv_style_init(&btn_focused_style); lv_style_set_border_width(&btn_focused_style, 1); lv_style_set_border_color(&btn_focused_style, makeLvColor(COLOR_THEME_FOCUS)); lv_style_set_text_color(&btn_focused_style, makeLvColor(COLOR_THEME_PRIMARY2)); lv_style_set_bg_color(&btn_focused_style, makeLvColor(COLOR_THEME_FOCUS)); - + + // Menus + lv_style_init(&menu_line_style); + lv_style_set_bg_opa(&menu_line_style, LV_OPA_100); + lv_style_set_bg_color(&menu_line_style, makeLvColor(COLOR_THEME_PRIMARY2)); + + lv_style_init(&menu_focused_style); + lv_style_set_border_width(&menu_focused_style, 1); + lv_style_set_border_color(&menu_focused_style, makeLvColor(COLOR_THEME_FOCUS)); + lv_style_set_text_color(&menu_focused_style, makeLvColor(COLOR_THEME_PRIMARY2)); + lv_style_set_bg_color(&menu_focused_style, makeLvColor(COLOR_THEME_FOCUS)); + /*Initialize the new theme from the current theme*/ lv_theme_t * th_act = lv_disp_get_theme(NULL); static lv_theme_t th_new; diff --git a/radio/src/thirdparty/libopenui b/radio/src/thirdparty/libopenui index dd5dc5232..844deb6c6 160000 --- a/radio/src/thirdparty/libopenui +++ b/radio/src/thirdparty/libopenui @@ -1 +1 @@ -Subproject commit dd5dc52327895a90885737c86ccd8554c59a486f +Subproject commit 844deb6c612d3d3811486c761341d24bdef9ebe7