diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-08-14 15:18:07 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-08-14 15:18:07 +0400 |
commit | 9bf603a30710fba42ace668dc0b32ac273059929 (patch) | |
tree | 067d079a044f0705e3459eb0ceced9ccb72601be /source/blender/editors | |
parent | a2dfeeaec0f42a209a45f140eecac930624ce4b9 (diff) |
Deactivate last active button for pie menu popups.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface.c | 5 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 155b059afe2..b4c2a431570 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -97,6 +97,11 @@ bool ui_block_is_menu(const uiBlock *block) ((block->flag & UI_BLOCK_KEEP_OPEN) == 0)); } +bool ui_block_is_pie_menu(const uiBlock *block) +{ + return ((block->flag & UI_BLOCK_RADIAL) != 0); +} + static bool ui_is_but_unit_radians_ex(UnitSettings *unit, const int unit_type) { return (unit->system_rotation == USER_UNIT_ROT_RADIANS && unit_type == PROP_UNIT_ROTATION); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index b95545ad8df..8e808b3e97b 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7945,7 +7945,7 @@ static int ui_handle_menu_button(bContext *C, const wmEvent *event, uiPopupBlock if (event->val == KM_RELEASE) { /* pass, needed so we can exit active menu-items when click-dragging out of them */ } - else if (!ui_block_is_menu(but->block)) { + else if (!(ui_block_is_menu(but->block) || ui_block_is_pie_menu(but->block))) { /* pass, skip for dialogs */ } else if (!ui_mouse_inside_region(but->active->region, event->x, event->y)) { diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index f5a965e9701..15cf14ae6ef 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -413,6 +413,7 @@ extern void ui_delete_linkline(uiLinkLine *line, uiBut *but); void ui_fontscale(short *points, float aspect); extern bool ui_block_is_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT; +extern bool ui_block_is_pie_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT; extern void ui_block_to_window_fl(const struct ARegion *ar, uiBlock *block, float *x, float *y); extern void ui_block_to_window(const struct ARegion *ar, uiBlock *block, int *x, int *y); extern void ui_block_to_window_rctf(const struct ARegion *ar, uiBlock *block, rctf *rct_dst, const rctf *rct_src); |