diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-05 20:54:06 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-05 20:54:06 +0200 |
commit | 5d95e1d76d12f72bf6e6c1d6809a201ba141a100 (patch) | |
tree | e565db8b94dab5de89314224d9ecef83d19a16a6 /src/ui/labelwidget.c | |
parent | 9fe6abe90dcaacfc9479b1c53edf2b239c81c4e5 (diff) |
Menu item icons
Diffstat (limited to 'src/ui/labelwidget.c')
-rw-r--r-- | src/ui/labelwidget.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index 3ebec790..4de00ec1 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c | |||
@@ -204,7 +204,8 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int | |||
204 | } | 204 | } |
205 | 205 | ||
206 | iLocalDef int iconPadding_LabelWidget_(const iLabelWidget *d) { | 206 | iLocalDef int iconPadding_LabelWidget_(const iLabelWidget *d) { |
207 | return d->icon ? iRound(lineHeight_Text(d->font) * 1.5f) : 0; | 207 | const float amount = flags_Widget(constAs_Widget(d)) & extraPadding_WidgetFlag ? 1.5f : 1.15f; |
208 | return d->icon ? iRound(lineHeight_Text(d->font) * amount) : 0; | ||
208 | } | 209 | } |
209 | 210 | ||
210 | static void draw_LabelWidget_(const iLabelWidget *d) { | 211 | static void draw_LabelWidget_(const iLabelWidget *d) { |
@@ -244,7 +245,8 @@ static void draw_LabelWidget_(const iLabelWidget *d) { | |||
244 | iString str; | 245 | iString str; |
245 | initUnicodeN_String(&str, &d->icon, 1); | 246 | initUnicodeN_String(&str, &d->icon, 1); |
246 | drawCentered_Text(d->font, | 247 | drawCentered_Text(d->font, |
247 | (iRect){ addX_I2(add_I2(bounds.pos, padding_(flags)), -2 * gap_UI), | 248 | (iRect){ addX_I2(add_I2(bounds.pos, padding_(flags)), |
249 | (flags & extraPadding_WidgetFlag ? -2 : -1) * gap_UI), | ||
248 | init_I2(iconPad, lineHeight_Text(d->font)) }, | 250 | init_I2(iconPad, lineHeight_Text(d->font)) }, |
249 | iTrue, | 251 | iTrue, |
250 | startsWith_String(&d->label, uiTextCaution_ColorEscape) | 252 | startsWith_String(&d->label, uiTextCaution_ColorEscape) |