summaryrefslogtreecommitdiff
path: root/src/ui/labelwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/labelwidget.c')
-rw-r--r--src/ui/labelwidget.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c
index 03595d1a..ec324d02 100644
--- a/src/ui/labelwidget.c
+++ b/src/ui/labelwidget.c
@@ -244,6 +244,9 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int
244 } 244 }
245 } 245 }
246 } 246 }
247 if (d->forceFg >= 0) {
248 *fg = d->forceFg;
249 }
247 if (isPress) { 250 if (isPress) {
248 *bg = uiBackgroundPressed_ColorId | permanent_ColorId; 251 *bg = uiBackgroundPressed_ColorId | permanent_ColorId;
249 if (isButton) { 252 if (isButton) {
@@ -257,9 +260,6 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int
257 *fg = isDark_ColorTheme(colorTheme_App()) ? white_ColorId : black_ColorId; 260 *fg = isDark_ColorTheme(colorTheme_App()) ? white_ColorId : black_ColorId;
258 } 261 }
259 } 262 }
260 if (d->forceFg >= 0) {
261 *fg = d->forceFg;
262 }
263} 263}
264 264
265iLocalDef int iconPadding_LabelWidget_(const iLabelWidget *d) { 265iLocalDef int iconPadding_LabelWidget_(const iLabelWidget *d) {
@@ -318,6 +318,10 @@ static void draw_LabelWidget_(const iLabelWidget *d) {
318 } 318 }
319 setClip_Paint(&p, rect); 319 setClip_Paint(&p, rect);
320 const int iconPad = iconPadding_LabelWidget_(d); 320 const int iconPad = iconPadding_LabelWidget_(d);
321 const int iconColor = isCaution ? uiTextCaution_ColorId
322 : flags & (disabled_WidgetFlag | pressed_WidgetFlag) ? fg
323 : isHover ? uiIconHover_ColorId
324 : uiIcon_ColorId;
321 if (d->icon && d->icon != 0x20) { /* no need to draw an empty icon */ 325 if (d->icon && d->icon != 0x20) { /* no need to draw an empty icon */
322 iString str; 326 iString str;
323 initUnicodeN_String(&str, &d->icon, 1); 327 initUnicodeN_String(&str, &d->icon, 1);
@@ -331,10 +335,7 @@ static void draw_LabelWidget_(const iLabelWidget *d) {
331 -gap_UI / 8)), 335 -gap_UI / 8)),
332 init_I2(iconPad, lineHeight_Text(d->font)) }, 336 init_I2(iconPad, lineHeight_Text(d->font)) },
333 iTrue, 337 iTrue,
334 isCaution ? uiTextCaution_ColorId 338 iconColor,
335 : flags & (disabled_WidgetFlag | pressed_WidgetFlag) ? fg
336 : isHover ? uiIconHover_ColorId
337 : uiIcon_ColorId,
338 "%s", 339 "%s",
339 cstr_String(&str)); 340 cstr_String(&str));
340 deinit_String(&str); 341 deinit_String(&str);
@@ -387,7 +388,7 @@ static void draw_LabelWidget_(const iLabelWidget *d) {
387 drawCentered_Text(d->font, 388 drawCentered_Text(d->font,
388 (iRect){ addX_I2(topRight_Rect(chRect), -iconPad), 389 (iRect){ addX_I2(topRight_Rect(chRect), -iconPad),
389 init_I2(chSize, height_Rect(chRect)) }, 390 init_I2(chSize, height_Rect(chRect)) },
390 iTrue, uiSeparator_ColorId, rightAngle_Icon); 391 iTrue, iconColor /*uiSeparator_ColorId*/, rightAngle_Icon);
391 } 392 }
392 unsetClip_Paint(&p); 393 unsetClip_Paint(&p);
393} 394}