summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-06 22:02:56 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-06 22:02:56 +0300
commit999d468b1ba3c25cd1921c0cf3e6402a54cce87c (patch)
treed14559ba117b0bb0b66102a5aa8e55e6edd46eed /src
parent7e63a70bc30173d2e15fda77777aef3caf0cc76c (diff)
DocumentWidget: Align banner icon visually
Diffstat (limited to 'src')
-rw-r--r--src/ui/documentwidget.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 6d9c3451..f146ed67 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -1079,9 +1079,12 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) {
1079 iInt2 bpos = add_I2(visPos, init_I2(0, lineHeight_Text(banner_FontId) / 2)); 1079 iInt2 bpos = add_I2(visPos, init_I2(0, lineHeight_Text(banner_FontId) / 2));
1080 if (icon) { 1080 if (icon) {
1081 format_String(&bannerText, "%lc", (int) icon); 1081 format_String(&bannerText, "%lc", (int) icon);
1082 const iInt2 iconSize = advanceN_Text(banner_FontId, cstr_String(&bannerText), 2); 1082 const iRect iconRect = visualBounds_Text(banner_FontId, range_String(&bannerText));
1083 drawRange_Text(run->font, bpos, tmBannerIcon_ColorId, range_String(&bannerText)); 1083 drawRange_Text(run->font,
1084 bpos.x += iconSize.x + 3 * gap_Text; 1084 addY_I2(bpos, -mid_Rect(iconRect).y + lineHeight_Text(run->font) / 2),
1085 tmBannerIcon_ColorId,
1086 range_String(&bannerText));
1087 bpos.x += right_Rect(iconRect) + 3 * gap_Text;
1085 } 1088 }
1086 drawRange_Text(run->font, 1089 drawRange_Text(run->font,
1087 bpos, 1090 bpos,