From e39a4035a622e1e9e1573cc567cb43652fdef231 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 18 Jan 2021 19:21:05 +0200 Subject: SidebarWidget: New color for feed names Separate the entry titles from the feed titles. --- src/ui/color.c | 4 ++++ src/ui/color.h | 1 + src/ui/sidebarwidget.c | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/color.c b/src/ui/color.c index 0cabdc49..0227bd3e 100644 --- a/src/ui/color.c +++ b/src/ui/color.c @@ -252,6 +252,10 @@ void setThemePalette_Color(enum iColorTheme theme) { copy_(uiMatching_ColorId, orange_ColorId); break; } + set_Color(uiSubheading_ColorId, + mix_Color(get_Color(uiText_ColorId), + get_Color(uiIcon_ColorId), + isDark_ColorTheme(theme) ? 0.5f : 0.75f)); set_Color(uiBackgroundUnfocusedSelection_ColorId, mix_Color(get_Color(uiBackground_ColorId), get_Color(uiBackgroundSelected_ColorId), isDark_ColorTheme(theme) ? 0.25f : 0.66f)); diff --git a/src/ui/color.h b/src/ui/color.h index b5d32ac4..6849ff2b 100644 --- a/src/ui/color.h +++ b/src/ui/color.h @@ -105,6 +105,7 @@ enum iColorId { uiBackgroundUnfocusedSelection_ColorId, uiBackgroundFolder_ColorId, uiTextDim_ColorId, + uiSubheading_ColorId, /* content theme colors */ tmFirst_ColorId, diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 38c854a2..56b8d097 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -1236,6 +1236,7 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect, deinit_String(&str); } /* Select the layout based on how the title fits. */ + int metaFg = isPressing ? fg : uiSubheading_ColorId; iInt2 titleSize = advanceRange_Text(titleFont, range_String(&d->label)); const iInt2 metaSize = advanceRange_Text(uiLabel_FontId, range_String(&d->meta)); pos.x += iconPad; @@ -1245,7 +1246,7 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect, /* Must wrap the title. */ pos.y += (itemHeight - h2 - h2) / 2; draw_Text( - uiLabel_FontId, addY_I2(pos, h2 - h1 - gap_UI / 8), fg, "%s \u2014 ", cstr_String(&d->meta)); + uiLabel_FontId, addY_I2(pos, h2 - h1 - gap_UI / 8), metaFg, "%s \u2014 ", cstr_String(&d->meta)); int skip = metaSize.x + advance_Text(uiLabel_FontId, " \u2014 ").x; iInt2 cur = addX_I2(pos, skip); const char *endPos; @@ -1263,7 +1264,7 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect, } else { pos.y += (itemHeight - h1 - h2) / 2; - drawRange_Text(uiLabel_FontId, pos, fg, range_String(&d->meta)); + drawRange_Text(uiLabel_FontId, pos, metaFg, range_String(&d->meta)); drawRange_Text(titleFont, addY_I2(pos, h1), labelFg, range_String(&d->label)); } } -- cgit v1.2.3