summaryrefslogtreecommitdiff
path: root/src/ui/widget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-12 13:36:28 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-12 13:36:28 +0300
commit7eea6f318d2252ccd92f6ed50e0320c143c40951 (patch)
treef651a4f70af3491a8dc05da6f6c06cbf368c9df6 /src/ui/widget.c
parent1d54f7b990ea7f676403681577fc4df984cab0be (diff)
Working on sidebar resizing
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r--src/ui/widget.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index b9fb12b9..2a889683 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -424,9 +424,9 @@ iBool processEvent_Widget(iWidget *d, const SDL_Event *ev) {
424 return iTrue; 424 return iTrue;
425 } 425 }
426 } 426 }
427 else if (d->flags & commandOnClick_WidgetFlag && (ev->type == SDL_MOUSEBUTTONDOWN || 427 else if (d->flags & commandOnClick_WidgetFlag &&
428 ev->type == SDL_MOUSEBUTTONUP) && 428 (ev->type == SDL_MOUSEBUTTONDOWN || ev->type == SDL_MOUSEBUTTONUP) &&
429 contains_Widget(d, init_I2(ev->button.x, ev->button.y))) { 429 (mouseGrab_Widget() == d || contains_Widget(d, init_I2(ev->button.x, ev->button.y)))) {
430 postCommand_Widget(d, 430 postCommand_Widget(d,
431 "mouse.clicked arg:%d button:%d coord:%d %d", 431 "mouse.clicked arg:%d button:%d coord:%d %d",
432 ev->type == SDL_MOUSEBUTTONDOWN ? 1 : 0, 432 ev->type == SDL_MOUSEBUTTONDOWN ? 1 : 0,
@@ -435,6 +435,11 @@ iBool processEvent_Widget(iWidget *d, const SDL_Event *ev) {
435 ev->button.y); 435 ev->button.y);
436 return iTrue; 436 return iTrue;
437 } 437 }
438 else if (d->flags & commandOnClick_WidgetFlag &&
439 mouseGrab_Widget() == d && ev->type == SDL_MOUSEMOTION) {
440 postCommand_Widget(d, "mouse.moved coord:%d %d", ev->motion.x, ev->motion.y);
441 return iTrue;
442 }
438 switch (ev->type) { 443 switch (ev->type) {
439 case SDL_USEREVENT: { 444 case SDL_USEREVENT: {
440 if (ev->user.code == command_UserEventCode && d->commandHandler && 445 if (ev->user.code == command_UserEventCode && d->commandHandler &&