diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-29 18:53:24 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-29 18:53:24 +0300 |
commit | f9cd528c5f13f9e7910b1e9a64ee70399a45d2e3 (patch) | |
tree | b896c910065adf9a604cf8903a7af2682c2c5f8c | |
parent | 1d8e3191b813de3ca7c55aab05cad18114c33cd1 (diff) |
SidebarWidget: Improved appearance of identities
-rw-r--r-- | src/ui/sidebarwidget.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 7d616469..37504661 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -246,8 +246,11 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { | |||
246 | appendFormat_String(&item.meta, "\n%s", expiry); | 246 | appendFormat_String(&item.meta, "\n%s", expiry); |
247 | } | 247 | } |
248 | else { | 248 | else { |
249 | appendFormat_String( | 249 | appendFormat_String(&item.meta, |
250 | &item.meta, " \u2014 %s\n%s", expiry, cstr_String(&ident->notes)); | 250 | " \u2014 %s\n%s%s", |
251 | expiry, | ||
252 | escape_Color(uiHeading_ColorId), | ||
253 | cstr_String(&ident->notes)); | ||
251 | } | 254 | } |
252 | item.isSelected = isActive; | 255 | item.isSelected = isActive; |
253 | pushBack_Array(&d->items, &item); | 256 | pushBack_Array(&d->items, &item); |
@@ -974,18 +977,20 @@ static void draw_SidebarWidget_(const iSidebarWidget *d) { | |||
974 | addv_I2(&cPos, | 977 | addv_I2(&cPos, |
975 | init_I2(3 * gap_UI, | 978 | init_I2(3 * gap_UI, |
976 | (d->itemHeight - lineHeight_Text(default_FontId) * 2 - | 979 | (d->itemHeight - lineHeight_Text(default_FontId) * 2 - |
977 | lineHeight_Text(font)) / 2)); | 980 | lineHeight_Text(font)) / |
978 | const int metaFg = isHover ? (isPressing ? uiTextPressed_ColorId | 981 | 2)); |
979 | : uiTextFramelessHover_ColorId) | 982 | const int metaFg = |
980 | : uiText_ColorId; | 983 | isHover ? permanent_ColorId | (isPressing ? uiTextPressed_ColorId |
984 | : uiTextFramelessHover_ColorId) | ||
985 | : uiText_ColorId; | ||
981 | drawRange_Text( | 986 | drawRange_Text( |
982 | font, cPos, item->isSelected ? iconColor : metaFg, range_String(&icon)); | 987 | font, cPos, item->isSelected ? iconColor : metaFg, range_String(&icon)); |
983 | deinit_String(&icon); | 988 | deinit_String(&icon); |
984 | drawRange_Text(font, add_I2(cPos, init_I2(7 * gap_UI, 0)), | 989 | drawRange_Text(font, add_I2(cPos, init_I2(6 * gap_UI, 0)), |
985 | fg, range_String(&item->label)); | 990 | fg, range_String(&item->label)); |
986 | drawRange_Text( | 991 | drawRange_Text( |
987 | default_FontId, | 992 | default_FontId, |
988 | add_I2(cPos, init_I2(0, lineHeight_Text(font))), | 993 | add_I2(cPos, init_I2(6 * gap_UI, lineHeight_Text(font))), |
989 | metaFg, | 994 | metaFg, |
990 | range_String(&item->meta)); | 995 | range_String(&item->meta)); |
991 | } | 996 | } |