summaryrefslogtreecommitdiff
path: root/src/ui/sidebarwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r--src/ui/sidebarwidget.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index 4c2a9d64..767847ac 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -618,7 +618,7 @@ static void updateMetrics_SidebarWidget_(iSidebarWidget *d) {
618 iMaxi(d->maxButtonLabelWidth, 618 iMaxi(d->maxButtonLabelWidth,
619 3 * gap_UI + measure_Text(font_LabelWidget(d->modeButtons[i]), 619 3 * gap_UI + measure_Text(font_LabelWidget(d->modeButtons[i]),
620 translateCStr_Lang(normalModeLabels_[i])) 620 translateCStr_Lang(normalModeLabels_[i]))
621 .x); 621 .bounds.size.x);
622 } 622 }
623 } 623 }
624 updateItemHeight_SidebarWidget_(d); 624 updateItemHeight_SidebarWidget_(d);
@@ -1672,8 +1672,8 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect,
1672 } 1672 }
1673 /* Select the layout based on how the title fits. */ 1673 /* Select the layout based on how the title fits. */
1674 int metaFg = isPressing ? fg : uiSubheading_ColorId; 1674 int metaFg = isPressing ? fg : uiSubheading_ColorId;
1675 iInt2 titleSize = advanceRange_Text(titleFont, range_String(&d->label)); 1675 iInt2 titleSize = measureRange_Text(titleFont, range_String(&d->label)).bounds.size;
1676 const iInt2 metaSize = advanceRange_Text(uiLabel_FontId, range_String(&d->meta)); 1676 const iInt2 metaSize = measureRange_Text(uiLabel_FontId, range_String(&d->meta)).bounds.size;
1677 pos.x += iconPad; 1677 pos.x += iconPad;
1678 const int avail = width_Rect(itemRect) - iconPad - 3 * gap_UI; 1678 const int avail = width_Rect(itemRect) - iconPad - 3 * gap_UI;
1679 const int labelFg = isPressing ? fg : (isUnread ? uiTextStrong_ColorId : uiText_ColorId); 1679 const int labelFg = isPressing ? fg : (isUnread ? uiTextStrong_ColorId : uiText_ColorId);
@@ -1682,7 +1682,7 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect,
1682 pos.y += (itemHeight - h2 - h2) / 2; 1682 pos.y += (itemHeight - h2 - h2) / 2;
1683 draw_Text( 1683 draw_Text(
1684 uiLabel_FontId, addY_I2(pos, h2 - h1 - gap_UI / 8), metaFg, "%s \u2014 ", cstr_String(&d->meta)); 1684 uiLabel_FontId, addY_I2(pos, h2 - h1 - gap_UI / 8), metaFg, "%s \u2014 ", cstr_String(&d->meta));
1685 int skip = metaSize.x + advance_Text(uiLabel_FontId, " \u2014 ").x; 1685 int skip = metaSize.x + measure_Text(uiLabel_FontId, " \u2014 ").advance.x;
1686 iInt2 cur = addX_I2(pos, skip); 1686 iInt2 cur = addX_I2(pos, skip);
1687 const char *endPos; 1687 const char *endPos;
1688 tryAdvance_Text(titleFont, range_String(&d->label), avail - skip, &endPos); 1688 tryAdvance_Text(titleFont, range_String(&d->label), avail - skip, &endPos);