[Bf-blender-cvs] [9bf603a] master: Deactivate last active button for pie menu popups.

Antony Riakiotakis noreply at git.blender.org
Thu Aug 14 13:18:18 CEST 2014


Commit: 9bf603a30710fba42ace668dc0b32ac273059929
Author: Antony Riakiotakis
Date:   Thu Aug 14 13:18:07 2014 +0200
Branches: master
https://developer.blender.org/rB9bf603a30710fba42ace668dc0b32ac273059929

Deactivate last active button for pie menu popups.

===================================================================

M	source/blender/editors/interface/interface.c
M	source/blender/editors/interface/interface_handlers.c
M	source/blender/editors/interface/interface_intern.h

===================================================================

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 155b059..b4c2a43 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 b95545a..8e808b3 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 f5a965e..15cf14a 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);




More information about the Bf-blender-cvs mailing list