diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-18 11:26:11 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-18 11:26:11 +0200 |
commit | fa174461abdc5c33de16428109c7d46b4f150093 (patch) | |
tree | 21cf16a2426f8a6b76195e1816ceea69778fbd70 /src/ui/listwidget.c | |
parent | 21f6248a3dc906a0c296b937dd1aa697784e6ea3 (diff) |
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.
Diffstat (limited to 'src/ui/listwidget.c')
-rw-r--r-- | src/ui/listwidget.c | 10 |
1 files changed, 7 insertions, 3 deletions
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) { | |||
379 | beginTarget_Paint(&p, buf->texture); | 379 | beginTarget_Paint(&p, buf->texture); |
380 | fillRect_Paint(&p, (iRect){ zero_I2(), d->visBuf->texSize }, bg[i]); | 380 | fillRect_Paint(&p, (iRect){ zero_I2(), d->visBuf->texSize }, bg[i]); |
381 | } | 381 | } |
382 | const iRect sbBlankRect = | 382 | #if defined (iPlatformApple) |
383 | { init_I2(d->visBuf->texSize.x - scrollBarWidth_ListWidget(d), 0), | 383 | const int blankWidth = 0; /* scrollbars fade away */ |
384 | init_I2(scrollBarWidth_ListWidget(d), d->itemHeight) }; | 384 | #else |
385 | const int blankWidth = scrollBarWidth_ListWidget(d); | ||
386 | #endif | ||
387 | const iRect sbBlankRect = { init_I2(d->visBuf->texSize.x - blankWidth, 0), | ||
388 | init_I2(blankWidth, d->itemHeight) }; | ||
385 | iConstForEach(IntSet, v, &d->invalidItems) { | 389 | iConstForEach(IntSet, v, &d->invalidItems) { |
386 | const size_t index = *v.value; | 390 | const size_t index = *v.value; |
387 | if (contains_Range(&drawItems, index)) { | 391 | if (contains_Range(&drawItems, index)) { |