From 15af9055eee460ef5387bab2ca877152a2aaeac7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 7 Mar 2020 15:52:24 +0400 Subject: [PATCH] Improve side bar layout. --- ui/colors.palette | 10 ++++++---- ui/widgets/side_bar_menu.cpp | 12 ++++-------- ui/widgets/widgets.style | 8 ++++---- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ui/colors.palette b/ui/colors.palette index 54e8489..96939bd 100644 --- a/ui/colors.palette +++ b/ui/colors.palette @@ -593,11 +593,13 @@ walletTopLabelFg: #999999; // wallet top updated label text walletTopIconFg: walletTopLabelFg; // wallet top refresh and menu icons walletTopIconRipple: #ffffff12; // wallet top menu icon ripple effect -sideBarBg: #36434c; // filters side bar background -sideBarTextFg: #93999e; // filters side bar text +sideBarBg: #293a4c; // filters side bar background +sideBarBgActive: #17212c; // filters side bar active background +sideBarBgRipple: #1c2835; // filters side bar ripple effect +sideBarTextFg: #8897a6; // filters side bar text sideBarTextFgActive: #64b9fa; // filters side bar active item text -sideBarIconFg: #979797; // filters side bar icon +sideBarIconFg: #8393a3; // filters side bar icon sideBarIconFgActive: #5eb5f7; // filters side bar active item icon sideBarBadgeBg: #5eb5f7; // filters side bar badge background -sideBarBadgeFgMuted: #aaaaaa; // filters side bar unimportant badge background +sideBarBadgeBgMuted: #aaaaaa; // filters side bar unimportant badge background sideBarBadgeFg: #ffffff; // filters side bar badge text diff --git a/ui/widgets/side_bar_menu.cpp b/ui/widgets/side_bar_menu.cpp index 4e6dd9b..8b70688 100644 --- a/ui/widgets/side_bar_menu.cpp +++ b/ui/widgets/side_bar_menu.cpp @@ -226,13 +226,6 @@ void SideBarMenu::paint(Painter &p, QRect clip) const { - _st.margins.left() - _st.margins.right(); p.fillRect(clip, _st.textBg); - _st.shadow.fill( - p, - QRect( - fullWidth - _st.shadow.width(), - 0, - _st.shadow.width(), - _inner->height())); for (const auto &item : _items) { if (y + item.height <= clip.y()) { y += item.height; @@ -240,13 +233,16 @@ void SideBarMenu::paint(Painter &p, QRect clip) const { } else if (y >= clip.y() + clip.height()) { break; } + const auto active = (item.data.id == _activeId); + if (active) { + p.fillRect(0, y, fullWidth, item.height, _st.textBgActive); + } if (item.ripple) { item.ripple->paint(p, 0, y, fullWidth, &_st.rippleBg->c); if (item.ripple->empty()) { item.ripple = nullptr; } } - const auto active = (item.data.id == _activeId); const auto icon = (active ? item.data.iconActive : item.data.icon); const auto x = (fullWidth - icon->width()) / 2; icon->paint(p, x, y + item.data.iconTop, fullWidth); diff --git a/ui/widgets/widgets.style b/ui/widgets/widgets.style index 5114ab6..1e4cc61 100644 --- a/ui/widgets/widgets.style +++ b/ui/widgets/widgets.style @@ -551,13 +551,13 @@ SideBarMenu { bottomSkip: pixels; style: TextStyle; textBg: color; + textBgActive: color; textFg: color; textFgActive: color; rippleBg: color; badgeBg: color; badgeBgMuted: color; badgeFg: color; - shadow: icon; } defaultLabelSimple: LabelSimple { @@ -1232,13 +1232,13 @@ defaultSideBarMenu: SideBarMenu { font: font(11px semibold); } textBg: sideBarBg; + textBgActive: sideBarBgActive; textFg: sideBarTextFg; textFgActive: sideBarTextFgActive; - rippleBg: shadowFg; + rippleBg: sideBarBgRipple; badgeBg: sideBarBadgeBg; - badgeBgMuted: sideBarBadgeFgMuted; + badgeBgMuted: sideBarBadgeBgMuted; badgeFg: sideBarBadgeFg; - shadow: icon {{ "slide_shadow", slideFadeOutShadowFg }}; } // Windows specific title