Skip to content

Commit

Permalink
Fix text color on active GVAR.
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz committed Dec 12, 2023
1 parent d688884 commit 14e8876
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
3 changes: 1 addition & 2 deletions radio/src/gui/colorlcd/model_gvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ static const lv_obj_class_t gv_group_class = {

static void gv_fmcont_constructor(const lv_obj_class_t* class_p, lv_obj_t* obj)
{
etx_obj_add_style(obj, styles->bg_opacity_cover, LV_PART_MAIN);
etx_obj_add_style(obj, styles->pad_zero, LV_PART_MAIN);
etx_bg_color(obj, COLOR_THEME_ACTIVE_INDEX, LV_PART_MAIN | LV_STATE_CHECKED);
etx_std_ctrl_colors(obj, LV_PART_MAIN);
lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE);
}

Expand Down
22 changes: 10 additions & 12 deletions radio/src/gui/colorlcd/themes/etx_lv_theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,15 @@ void etx_std_ctrl_colors(lv_obj_t* obj, lv_style_selector_t selector)
{
etx_solid_bg(obj, COLOR_THEME_PRIMARY2_INDEX, selector);
etx_txt_color(obj, COLOR_THEME_SECONDARY1_INDEX, selector);

etx_obj_add_style(obj, styles->border_color_focus,
selector | LV_STATE_FOCUSED);

etx_bg_color(obj, COLOR_THEME_ACTIVE_INDEX, selector | LV_STATE_CHECKED);
etx_txt_color(obj, COLOR_THEME_PRIMARY1_INDEX, selector | LV_STATE_CHECKED);

etx_obj_add_style(obj, styles->outline_color_focus,
selector | LV_STATE_FOCUSED);
}

void etx_std_style(lv_obj_t* obj, lv_style_selector_t selector,
Expand All @@ -413,21 +422,10 @@ void etx_std_style(lv_obj_t* obj, lv_style_selector_t selector,
etx_obj_add_style(obj, styles->rounded, selector);
etx_std_ctrl_colors(obj, selector);

etx_obj_add_style(obj, styles->border_color_focus,
selector | LV_STATE_FOCUSED);

etx_obj_add_style(obj, styles->outline,
selector | LV_STATE_FOCUSED);
etx_obj_add_style(obj, styles->outline_color_focus,
selector | LV_STATE_FOCUSED);

etx_obj_add_style(obj, styles->outline, selector | LV_STATE_FOCUSED);
etx_obj_add_style(obj, styles->disabled, selector | LV_STATE_DISABLED);

etx_obj_add_style(obj, styles->pressed, selector | LV_STATE_PRESSED);

etx_bg_color(obj, COLOR_THEME_ACTIVE_INDEX, selector | LV_STATE_CHECKED);
etx_txt_color(obj, COLOR_THEME_PRIMARY1_INDEX, selector | LV_STATE_CHECKED);

switch (padding) {
case PAD_TINY:
etx_obj_add_style(obj, styles->pad_tiny, selector);
Expand Down

0 comments on commit 14e8876

Please sign in to comment.