From 73cdfdf0c1430ad247c5d927459e2f8fad7b2d00 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 30 Nov 2021 15:46:34 +0200 Subject: LabelWidget: Selection background of menu items Highlight the currently selected item with a dimmer background to differentiate from hover item. --- src/ui/labelwidget.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index f6ddfd43..4dd66a28 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c @@ -198,6 +198,7 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int const iBool isSel = (flags & selected_WidgetFlag) != 0; const iBool isFrameless = (flags & frameless_WidgetFlag) != 0; const iBool isButton = d->click.button != 0; + const iBool isMenuItem = !cmp_String(id_Widget(parent_Widget(d)), "menu"); const iBool isKeyRoot = (w->root == get_Window()->keyRoot); const iBool isDarkTheme = isDark_ColorTheme(colorTheme_App()); /* Default color state. */ @@ -215,7 +216,12 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int *meta = uiTextDisabled_ColorId; } if (isSel) { - *bg = uiBackgroundSelected_ColorId; + if (isMenuItem) { + *bg = uiBackgroundUnfocusedSelection_ColorId; + } + else { + *bg = uiBackgroundSelected_ColorId; + } // if (!isKeyRoot) { // *bg = uiEmbossSelected1_ColorId; //uiBackgroundUnfocusedSelection_ColorId; // } -- cgit v1.2.3