summaryrefslogtreecommitdiff
path: root/src/ui/scrollwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-23 21:42:32 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-23 21:42:32 +0200
commite608b04a9e46e75c8c1179f47d0b65fb2f26c2d9 (patch)
treeee3de6478486e7c18deaa6cf36007334fa0491d0 /src/ui/scrollwidget.c
parentadfd2d702195103e69a3cacdeadb9709ba9be130 (diff)
SidebarWidget: Improved feed entry appearance
Diffstat (limited to 'src/ui/scrollwidget.c')
-rw-r--r--src/ui/scrollwidget.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ui/scrollwidget.c b/src/ui/scrollwidget.c
index f5340897..649d0575 100644
--- a/src/ui/scrollwidget.c
+++ b/src/ui/scrollwidget.c
@@ -131,14 +131,15 @@ static iBool processEvent_ScrollWidget_(iScrollWidget *d, const SDL_Event *ev) {
131} 131}
132 132
133static void draw_ScrollWidget_(const iScrollWidget *d) { 133static void draw_ScrollWidget_(const iScrollWidget *d) {
134 const iWidget *w = constAs_Widget(d); 134 const iWidget *w = constAs_Widget(d);
135 const iRect bounds = bounds_Widget(w); 135 const iRect bounds = bounds_Widget(w);
136 const iBool isPressed = (flags_Widget(w) & pressed_WidgetFlag) != 0; 136 const iBool isPressed = (flags_Widget(w) & pressed_WidgetFlag) != 0;
137 if (bounds.size.x > 0) { 137 if (bounds.size.x > 0) {
138 iPaint p; 138 iPaint p;
139 init_Paint(&p); 139 init_Paint(&p);
140 drawVLine_Paint(&p, topLeft_Rect(bounds), height_Rect(bounds), uiSeparator_ColorId); 140 drawVLine_Paint(&p, topLeft_Rect(bounds), height_Rect(bounds), uiSeparator_ColorId);
141 const iRect thumbRect = shrunk_Rect(thumbRect_ScrollWidget_(d), init_I2(gap_UI, gap_UI / 2)); 141 const iRect thumbRect = shrunk_Rect(
142 thumbRect_ScrollWidget_(d), init_I2(isPressed ? gap_UI : (gap_UI * 4 / 3), gap_UI / 2));
142 fillRect_Paint(&p, thumbRect, isPressed ? uiBackgroundPressed_ColorId : tmQuote_ColorId); 143 fillRect_Paint(&p, thumbRect, isPressed ? uiBackgroundPressed_ColorId : tmQuote_ColorId);
143 } 144 }
144} 145}