From e31f1118512282550ba484a591b23638f75d819f Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 2 Jan 2021 21:23:04 +0200 Subject: SidebarWidget: Background color for remote bookmarks --- src/ui/color.c | 6 ++++++ src/ui/color.h | 1 + src/ui/sidebarwidget.c | 6 ++++++ 3 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/ui/color.c b/src/ui/color.c index 1bab8538..dc19dd39 100644 --- a/src/ui/color.c +++ b/src/ui/color.c @@ -254,6 +254,12 @@ void setThemePalette_Color(enum iColorTheme theme) { set_Color(uiBackgroundUnfocusedSelection_ColorId, mix_Color(get_Color(uiBackground_ColorId), get_Color(uiBackgroundSelected_ColorId), isDark_ColorTheme(theme) ? 0.25f : 0.66f)); + setHsl_Color(uiBackgroundFolder_ColorId, + addSatLum_HSLColor(get_HSLColor(uiBackground_ColorId), + 0, + theme == pureBlack_ColorTheme ? 0.075 + : theme == dark_ColorTheme ? -0.033 + : -0.075)); palette_[uiMarked_ColorId].a = 128; palette_[uiMatching_ColorId].a = 128; } diff --git a/src/ui/color.h b/src/ui/color.h index 61da37c0..b5d32ac4 100644 --- a/src/ui/color.h +++ b/src/ui/color.h @@ -103,6 +103,7 @@ enum iColorId { uiMarked_ColorId, uiMatching_ColorId, uiBackgroundUnfocusedSelection_ColorId, + uiBackgroundFolder_ColorId, uiTextDim_ColorId, /* content theme colors */ diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index e28f86f9..bec6d87a 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -1163,6 +1163,12 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect, bg = uiBackgroundUnfocusedSelection_ColorId; fillRect_Paint(p, itemRect, bg); } + else if (sidebar->mode == bookmarks_SidebarMode) { + if (d->icon == 0x2913) { /* TODO: Remote icon; meaning: is this in a folder? */ + bg = uiBackgroundFolder_ColorId; + fillRect_Paint(p, itemRect, bg); + } + } iInt2 pos = itemRect.pos; if (sidebar->mode == documentOutline_SidebarMode) { const int fg = isHover ? (isPressing ? uiTextPressed_ColorId : uiTextFramelessHover_ColorId) -- cgit v1.2.3