diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-11-30 15:46:34 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-11-30 15:46:34 +0200 |
commit | 73cdfdf0c1430ad247c5d927459e2f8fad7b2d00 (patch) | |
tree | 368f2de676ba0a3c495e12c2cce1190eee8b5915 | |
parent | 09daf335df3b10c67e882234b2f1b11ff097afaf (diff) |
LabelWidget: Selection background of menu items
Highlight the currently selected item with a dimmer background to differentiate from hover item.
-rw-r--r-- | src/ui/labelwidget.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 | |||
198 | const iBool isSel = (flags & selected_WidgetFlag) != 0; | 198 | const iBool isSel = (flags & selected_WidgetFlag) != 0; |
199 | const iBool isFrameless = (flags & frameless_WidgetFlag) != 0; | 199 | const iBool isFrameless = (flags & frameless_WidgetFlag) != 0; |
200 | const iBool isButton = d->click.button != 0; | 200 | const iBool isButton = d->click.button != 0; |
201 | const iBool isMenuItem = !cmp_String(id_Widget(parent_Widget(d)), "menu"); | ||
201 | const iBool isKeyRoot = (w->root == get_Window()->keyRoot); | 202 | const iBool isKeyRoot = (w->root == get_Window()->keyRoot); |
202 | const iBool isDarkTheme = isDark_ColorTheme(colorTheme_App()); | 203 | const iBool isDarkTheme = isDark_ColorTheme(colorTheme_App()); |
203 | /* Default color state. */ | 204 | /* Default color state. */ |
@@ -215,7 +216,12 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int | |||
215 | *meta = uiTextDisabled_ColorId; | 216 | *meta = uiTextDisabled_ColorId; |
216 | } | 217 | } |
217 | if (isSel) { | 218 | if (isSel) { |
218 | *bg = uiBackgroundSelected_ColorId; | 219 | if (isMenuItem) { |
220 | *bg = uiBackgroundUnfocusedSelection_ColorId; | ||
221 | } | ||
222 | else { | ||
223 | *bg = uiBackgroundSelected_ColorId; | ||
224 | } | ||
219 | // if (!isKeyRoot) { | 225 | // if (!isKeyRoot) { |
220 | // *bg = uiEmbossSelected1_ColorId; //uiBackgroundUnfocusedSelection_ColorId; | 226 | // *bg = uiEmbossSelected1_ColorId; //uiBackgroundUnfocusedSelection_ColorId; |
221 | // } | 227 | // } |