diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-20 21:07:03 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-20 21:07:03 +0300 |
commit | 5eef316269435522111db7d1b51c8a82a6ecda0d (patch) | |
tree | 84f14851675b1a64e90d29a8dea2ca77e387b21d /src/ui/listwidget.c | |
parent | 046869954cceb49f106e3a5051517050a5515b31 (diff) |
SidebarWidget: Identities list click behavior
Avoid accidental activations by never (de)activating identities based on a single click. Now both left and right mouse clicks will open the context menu.
Diffstat (limited to 'src/ui/listwidget.c')
-rw-r--r-- | src/ui/listwidget.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/listwidget.c b/src/ui/listwidget.c index a3406d48..a43b11ee 100644 --- a/src/ui/listwidget.c +++ b/src/ui/listwidget.c | |||
@@ -369,6 +369,13 @@ static iBool processEvent_ListWidget_(iListWidget *d, const SDL_Event *ev) { | |||
369 | return processEvent_Widget(w, ev); | 369 | return processEvent_Widget(w, ev); |
370 | } | 370 | } |
371 | 371 | ||
372 | iRect itemRect_ListWidget(const iListWidget *d, size_t index) { | ||
373 | const iRect bounds = innerBounds_Widget(constAs_Widget(d)); | ||
374 | const int scrollY = pos_SmoothScroll(&d->scrollY); | ||
375 | return (iRect){ addY_I2(topLeft_Rect(bounds), d->itemHeight * (int) index - scrollY), | ||
376 | init_I2(width_Rect(bounds), d->itemHeight) }; | ||
377 | } | ||
378 | |||
372 | static void draw_ListWidget_(const iListWidget *d) { | 379 | static void draw_ListWidget_(const iListWidget *d) { |
373 | const iWidget *w = constAs_Widget(d); | 380 | const iWidget *w = constAs_Widget(d); |
374 | const iRect bounds = innerBounds_Widget(w); | 381 | const iRect bounds = innerBounds_Widget(w); |