diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-06-20 11:30:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-06-20 11:34:21 +0400 |
commit | 8660a0cab3e0f5b05a14b362e9a5174acf969c54 (patch) | |
tree | 093efdea3d97a54941c567a8f7603643e30b1d76 /source | |
parent | ead83a48f15c7677290fdedfde974ff3233e0441 (diff) |
UI: auto-open other menus by hovering over, once a menu is already open
D590 by Matthew Reid
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 229bc76f65a..9189f14dd7c 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -8370,12 +8370,24 @@ static int ui_handler_region_menu(bContext *C, const wmEvent *event, void *UNUSE but = ui_but_find_activated(ar); if (but) { + uiBut *but_other; uiHandleButtonData *data; /* handle activated button events */ data = but->active; - if (data->state == BUTTON_STATE_MENU_OPEN) { + if ((data->state == BUTTON_STATE_MENU_OPEN) && + (but->type == PULLDOWN) && + (but_other = ui_but_find_mouse_over(ar, event)) && + (but != but_other) && + (but->type == but_other->type)) + { + /* if mouse moves to a different root-level menu button, + * open it to replace the current menu */ + ui_handle_button_activate(C, ar, but_other, BUTTON_ACTIVATE_OVER); + button_activate_state(C, but_other, BUTTON_STATE_MENU_OPEN); + } + else if (data->state == BUTTON_STATE_MENU_OPEN) { int retval; /* handle events for menus and their buttons recursively, |