From fa174461abdc5c33de16428109c7d46b4f150093 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 18 Mar 2021 11:26:11 +0200 Subject: Scrollbar fading and periodic commands Added a new mechanism to issue periodic but not per-frame commands. This is used for main-thread operations like checking if it's time to fade away the scrollbars. Scrollbars are faded away completely on Apple platforms. Adjusted list right margins accordingly. --- src/ui/listwidget.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/ui/listwidget.c') diff --git a/src/ui/listwidget.c b/src/ui/listwidget.c index 237562ca..f351c3b3 100644 --- a/src/ui/listwidget.c +++ b/src/ui/listwidget.c @@ -379,9 +379,13 @@ static void draw_ListWidget_(const iListWidget *d) { beginTarget_Paint(&p, buf->texture); fillRect_Paint(&p, (iRect){ zero_I2(), d->visBuf->texSize }, bg[i]); } - const iRect sbBlankRect = - { init_I2(d->visBuf->texSize.x - scrollBarWidth_ListWidget(d), 0), - init_I2(scrollBarWidth_ListWidget(d), d->itemHeight) }; +#if defined (iPlatformApple) + const int blankWidth = 0; /* scrollbars fade away */ +#else + const int blankWidth = scrollBarWidth_ListWidget(d); +#endif + const iRect sbBlankRect = { init_I2(d->visBuf->texSize.x - blankWidth, 0), + init_I2(blankWidth, d->itemHeight) }; iConstForEach(IntSet, v, &d->invalidItems) { const size_t index = *v.value; if (contains_Range(&drawItems, index)) { -- cgit v1.2.3