summaryrefslogtreecommitdiff
path: root/src/ui/labelwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-12-09 11:35:03 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-12-09 11:35:03 +0200
commitc17fe5ed17c906b0c0bc21e07d87d281d04e10e6 (patch)
tree98a0102066ecb14354ea6f161bed17211de6edf7 /src/ui/labelwidget.c
parentf969ea2d93208bcc99eb9e513275686dfee5108a (diff)
UploadWidget: Improved Identity dropdown
Better colors, keep the menu button fixed-height.
Diffstat (limited to 'src/ui/labelwidget.c')
-rw-r--r--src/ui/labelwidget.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c
index d00733e1..9e0d37e4 100644
--- a/src/ui/labelwidget.c
+++ b/src/ui/labelwidget.c
@@ -195,6 +195,7 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int
195 int *icon, int *meta) { 195 int *icon, int *meta) {
196 const iWidget *w = constAs_Widget(d); 196 const iWidget *w = constAs_Widget(d);
197 const int64_t flags = flags_Widget(w); 197 const int64_t flags = flags_Widget(w);
198 const iBool isHover = isHover_LabelWidget_(d);
198 const iBool isFocus = (flags & focusable_WidgetFlag && isFocused_Widget(d)); 199 const iBool isFocus = (flags & focusable_WidgetFlag && isFocused_Widget(d));
199 const iBool isPress = (flags & pressed_WidgetFlag) != 0; 200 const iBool isPress = (flags & pressed_WidgetFlag) != 0;
200 const iBool isSel = (flags & selected_WidgetFlag) != 0; 201 const iBool isSel = (flags & selected_WidgetFlag) != 0;
@@ -222,9 +223,6 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int
222 if (isSel) { 223 if (isSel) {
223 if (!d->flags.checkMark) { 224 if (!d->flags.checkMark) {
224 *bg = uiBackgroundSelected_ColorId; 225 *bg = uiBackgroundSelected_ColorId;
225// if (!isKeyRoot) {
226// *bg = uiEmbossSelected1_ColorId; //uiBackgroundUnfocusedSelection_ColorId;
227// }
228 if (!isKeyRoot) { 226 if (!isKeyRoot) {
229 *bg = isDark_ColorTheme(colorTheme_App()) ? uiBackgroundUnfocusedSelection_ColorId 227 *bg = isDark_ColorTheme(colorTheme_App()) ? uiBackgroundUnfocusedSelection_ColorId
230 : uiMarked_ColorId; 228 : uiMarked_ColorId;
@@ -249,7 +247,7 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int
249 if (colorEscape == uiTextCaution_ColorId) { 247 if (colorEscape == uiTextCaution_ColorId) {
250 *icon = *meta = colorEscape; 248 *icon = *meta = colorEscape;
251 } 249 }
252 if (isHover_LabelWidget_(d)) { 250 if (isHover) {
253 if (isFrameless) { 251 if (isFrameless) {
254 *bg = uiBackgroundFramelessHover_ColorId; 252 *bg = uiBackgroundFramelessHover_ColorId;
255 *fg = uiTextFramelessHover_ColorId; 253 *fg = uiTextFramelessHover_ColorId;
@@ -275,7 +273,7 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int
275 } 273 }
276 } 274 }
277 if (d->forceFg >= 0) { 275 if (d->forceFg >= 0) {
278 *fg = /* *icon = */ *meta = d->forceFg; 276 *fg = *meta = d->forceFg;
279 } 277 }
280 if (isPress) { 278 if (isPress) {
281 if (colorEscape == uiTextAction_ColorId || colorEscape == uiTextCaution_ColorId) { 279 if (colorEscape == uiTextAction_ColorId || colorEscape == uiTextCaution_ColorId) {
@@ -290,14 +288,13 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int
290 *frame1 = uiEmbossPressed1_ColorId; 288 *frame1 = uiEmbossPressed1_ColorId;
291 *frame2 = colorEscape != none_ColorId ? colorEscape : uiEmbossPressed2_ColorId; 289 *frame2 = colorEscape != none_ColorId ? colorEscape : uiEmbossPressed2_ColorId;
292 } 290 }
293 //if (colorEscape == none_ColorId || colorEscape == uiTextAction_ColorId) {
294 *fg = *icon = *meta = uiTextPressed_ColorId | permanent_ColorId; 291 *fg = *icon = *meta = uiTextPressed_ColorId | permanent_ColorId;
295 // }
296 // else {
297 // *fg = (isDark_ColorTheme(colorTheme_App()) ? white_ColorId : black_ColorId) | permanent_ColorId;
298 // }
299 } 292 }
300 } 293 }
294 if (((isSel || isHover) && isFrameless) || isPress) {
295 /* Ensure that the full label text remains readable. */
296 *fg |= permanent_ColorId;
297 }
301} 298}
302 299
303iLocalDef int iconPadding_LabelWidget_(const iLabelWidget *d) { 300iLocalDef int iconPadding_LabelWidget_(const iLabelWidget *d) {