summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-01-18 19:21:05 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-01-18 19:21:05 +0200
commite39a4035a622e1e9e1573cc567cb43652fdef231 (patch)
tree4df756ec4ad40e179166d24918c6229e51bfc807 /src
parent1ac1db7f0b508e6219dce4aa2fbd2c5515472506 (diff)
SidebarWidget: New color for feed names
Separate the entry titles from the feed titles.
Diffstat (limited to 'src')
-rw-r--r--src/ui/color.c4
-rw-r--r--src/ui/color.h1
-rw-r--r--src/ui/sidebarwidget.c5
3 files changed, 8 insertions, 2 deletions
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) {
252 copy_(uiMatching_ColorId, orange_ColorId); 252 copy_(uiMatching_ColorId, orange_ColorId);
253 break; 253 break;
254 } 254 }
255 set_Color(uiSubheading_ColorId,
256 mix_Color(get_Color(uiText_ColorId),
257 get_Color(uiIcon_ColorId),
258 isDark_ColorTheme(theme) ? 0.5f : 0.75f));
255 set_Color(uiBackgroundUnfocusedSelection_ColorId, mix_Color(get_Color(uiBackground_ColorId), 259 set_Color(uiBackgroundUnfocusedSelection_ColorId, mix_Color(get_Color(uiBackground_ColorId),
256 get_Color(uiBackgroundSelected_ColorId), 260 get_Color(uiBackgroundSelected_ColorId),
257 isDark_ColorTheme(theme) ? 0.25f : 0.66f)); 261 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 {
105 uiBackgroundUnfocusedSelection_ColorId, 105 uiBackgroundUnfocusedSelection_ColorId,
106 uiBackgroundFolder_ColorId, 106 uiBackgroundFolder_ColorId,
107 uiTextDim_ColorId, 107 uiTextDim_ColorId,
108 uiSubheading_ColorId,
108 109
109 /* content theme colors */ 110 /* content theme colors */
110 tmFirst_ColorId, 111 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,
1236 deinit_String(&str); 1236 deinit_String(&str);
1237 } 1237 }
1238 /* Select the layout based on how the title fits. */ 1238 /* Select the layout based on how the title fits. */
1239 int metaFg = isPressing ? fg : uiSubheading_ColorId;
1239 iInt2 titleSize = advanceRange_Text(titleFont, range_String(&d->label)); 1240 iInt2 titleSize = advanceRange_Text(titleFont, range_String(&d->label));
1240 const iInt2 metaSize = advanceRange_Text(uiLabel_FontId, range_String(&d->meta)); 1241 const iInt2 metaSize = advanceRange_Text(uiLabel_FontId, range_String(&d->meta));
1241 pos.x += iconPad; 1242 pos.x += iconPad;
@@ -1245,7 +1246,7 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect,
1245 /* Must wrap the title. */ 1246 /* Must wrap the title. */
1246 pos.y += (itemHeight - h2 - h2) / 2; 1247 pos.y += (itemHeight - h2 - h2) / 2;
1247 draw_Text( 1248 draw_Text(
1248 uiLabel_FontId, addY_I2(pos, h2 - h1 - gap_UI / 8), fg, "%s \u2014 ", cstr_String(&d->meta)); 1249 uiLabel_FontId, addY_I2(pos, h2 - h1 - gap_UI / 8), metaFg, "%s \u2014 ", cstr_String(&d->meta));
1249 int skip = metaSize.x + advance_Text(uiLabel_FontId, " \u2014 ").x; 1250 int skip = metaSize.x + advance_Text(uiLabel_FontId, " \u2014 ").x;
1250 iInt2 cur = addX_I2(pos, skip); 1251 iInt2 cur = addX_I2(pos, skip);
1251 const char *endPos; 1252 const char *endPos;
@@ -1263,7 +1264,7 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect,
1263 } 1264 }
1264 else { 1265 else {
1265 pos.y += (itemHeight - h1 - h2) / 2; 1266 pos.y += (itemHeight - h1 - h2) / 2;
1266 drawRange_Text(uiLabel_FontId, pos, fg, range_String(&d->meta)); 1267 drawRange_Text(uiLabel_FontId, pos, metaFg, range_String(&d->meta));
1267 drawRange_Text(titleFont, addY_I2(pos, h1), labelFg, range_String(&d->label)); 1268 drawRange_Text(titleFont, addY_I2(pos, h1), labelFg, range_String(&d->label));
1268 } 1269 }
1269 } 1270 }