From d6bc169017c90cf4425960e7c9cef2fd6a67cd68 Mon Sep 17 00:00:00 2001 From: "Michael A. Cojocari" Date: Tue, 29 Sep 2026 20:20:18 -0400 Subject: [PATCH] fix(ui): Map side buttons show which one is selected (#576) The keyboard/trackball cursor is a 3 px accent outline, and on an accent fill it disappears. setSelectionGlow already swaps to the contrast outline (white, black on Day) there, but only for a fully opaque fill; the Map's side buttons are accent at 70% over the tiles, so they kept the accent outline and the selected one barely stood out. Any fill that is at least half accent now takes the contrast outline. Co-Authored-By: Claude Opus 5.5 --- src/ui-touch/UITask.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ui-touch/UITask.cpp b/src/ui-touch/UITask.cpp index be1bf49..bed829e 100644 --- a/src/ui-touch/UITask.cpp +++ b/src/ui-touch/UITask.cpp @@ -1977,7 +1977,11 @@ static void setSelectionGlow(lv_obj_t* obj, bool selected, lv_style_selector_t s lv_obj_remove_style(obj, &s_selection_glow_style, cursor_selector); lv_obj_remove_style(obj, &s_selection_glow_contrast_style, cursor_selector); if (selected) { - const bool on_accent = lv_obj_get_style_bg_opa(obj, cursor_part) == LV_OPA_COVER && + // An accent outline vanishes on an accent fill, and not only a solid one: + // the Map's side buttons are accent at 70% over the tiles, and their cursor + // could barely be told from its neighbours (#576). Anything mostly accent + // takes the contrast outline instead. + const bool on_accent = lv_obj_get_style_bg_opa(obj, cursor_part) >= LV_OPA_50 && lv_color_to32(lv_obj_get_style_bg_color(obj, cursor_part)) == lv_color_to32(lv_color_hex(COLOR_ACCENT)); lv_obj_add_style(obj, on_accent ? &s_selection_glow_contrast_style