summaryrefslogtreecommitdiff
path: root/scene/gui/reference_rect.h
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2018-03-27 23:41:27 +0200
committerPedro J. Estébanez <pedrojrulez@gmail.com>2018-04-07 01:06:02 +0200
commit259ed1d40019543dd22c3741eedfd19ff0a7a500 (patch)
tree0086bf615e23c09c667d46c3db7965d3db63d4bb /scene/gui/reference_rect.h
parent4a5723f59e0437dc9f83f7116b8fddd12e15c5d0 (diff)
Improve popup menus usability
It seems that popups were intended to "grab" the mouse click that triggered them, but their intent was being lost. This commit does the necessary changes to let it happen and updates items that were trying to get advantage of it, because the semantics of `Control::grab_click_focus()` have changed a bit. Namely, it must be called **before** showing the modal. This allows to popup a menu and activate an item in it in a single click-point-release cycle, instead of having to click once to open the menu and once more to pick an item. This ability is extended even to context menus activated with the RMB (or any other mouse button, for that matter). The editor benefits from this in the context menu of the tree dock, which has been patched to opt-in for this feature. This improves UX a bit by saving unnecessary clicks. From now on, `PopupMenu` always grabs the click and also invalidates the first button release unless the mouse has moved (that's what `set_invalidate_click_until_motion()` was doing and now it's removed), so there is no longer the need of doing both things at every point a pop-up menu is shown.
Diffstat (limited to 'scene/gui/reference_rect.h')
0 files changed, 0 insertions, 0 deletions