[Bf-blender-cvs] [bc11096] pie-menus: Change to pie iinteraction:
Antony Riakiotakis
noreply at git.blender.org
Tue Jul 29 14:36:34 CEST 2014
Commit: bc11096db4a9da1c7e24a7cd7c1bb6c6cc768e6a
Author: Antony Riakiotakis
Date: Tue Jul 29 14:35:34 2014 +0200
Branches: pie-menus
https://developer.blender.org/rBbc11096db4a9da1c7e24a7cd7c1bb6c6cc768e6a
Change to pie iinteraction:
After discussion with Campbell use combination of drag/click style
interaction and ommit option:
If initial button is released while the menu is still within the
threshold then switch to click style. If not then do regular selection.
===================================================================
M release/scripts/startup/bl_ui/space_userpref.py
M source/blender/editors/interface/interface_handlers.c
M source/blender/makesdna/DNA_userdef_types.h
M source/blender/makesrna/intern/rna_userdef.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 979e5d02..98f391c 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -219,7 +219,6 @@ class USERPREF_PT_interface(Panel):
col.separator()
col.label(text="Pie Menus:")
sub = col.column(align=True)
- sub.prop(view, "pie_interaction_type", text="")
sub.prop(view, "pie_operator_timeout")
sub.prop(view, "pie_animation_timeout")
sub.prop(view, "pie_initial_timeout")
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index b998fdb..b505701 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -8509,7 +8509,7 @@ static int ui_handle_menu_return_submenu(bContext *C, const wmEvent *event, uiPo
if (menu->menuretval) {
/* pie menus should not close but wait for release instead */
if ((block->flag & UI_BLOCK_RADIAL) &&
- !((block->pie_data.flags & UI_PIE_CLICK_STYLE) || U.pie_interaction_type == USER_UI_PIE_CLICK))
+ !(block->pie_data.flags & UI_PIE_CLICK_STYLE))
{
menu->menuretval = 0;
block->pie_data.flags |= UI_PIE_FINISHED;
@@ -8587,7 +8587,7 @@ static int ui_handler_pie(bContext *C, const wmEvent *event, uiPopupBlockHandle
ar = menu->region;
block = ar->uiblocks.first;
- is_click_style = (U.pie_interaction_type == USER_UI_PIE_CLICK) || (block->pie_data.flags & UI_PIE_CLICK_STYLE);
+ is_click_style = (block->pie_data.flags & UI_PIE_CLICK_STYLE);
if (menu->scrolltimer == NULL) {
menu->scrolltimer =
@@ -8663,7 +8663,10 @@ static int ui_handler_pie(bContext *C, const wmEvent *event, uiPopupBlockHandle
ED_region_tag_redraw(ar);
}
else {
- if (!is_click_style) {
+ if (block->pie_data.flags & UI_PIE_INVALID_DIR) {
+ block->pie_data.flags |= UI_PIE_CLICK_STYLE;
+ }
+ else if (!is_click_style) {
uiBut *but = ui_but_find_activated(menu->region);
retval = ui_pie_menu_apply(C, menu, but, event, true, is_click_style);
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index bfa154d..7ea2770 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -853,10 +853,6 @@ typedef enum eImageDrawMethod {
IMAGE_DRAW_METHOD_DRAWPIXELS = 3,
} eImageDrawMethod;
-typedef enum eUIInteraction {
- USER_UI_PIE_DRAG = 0,
- USER_UI_PIE_CLICK = 1
-} eUIInteraction;
#ifdef __cplusplus
}
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 2168a50..f5d459a 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3158,12 +3158,6 @@ static void rna_def_userdef_view(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
- static EnumPropertyItem pie_styles[] = {
- {USER_UI_PIE_CLICK, "CLICK", 0, "Click", "Press to spawn pie menu, click to confirm"},
- {USER_UI_PIE_DRAG, "DRAG", 0, "Drag", "Press and hold to spawn pie menu, release to confirm"},
- {0, NULL, 0, NULL, NULL}
- };
-
PropertyRNA *prop;
StructRNA *srna;
@@ -3233,10 +3227,6 @@ static void rna_def_userdef_view(BlenderRNA *brna)
"Time delay in 1/10 seconds before automatically opening sub level menus");
/* pie menus */
- prop = RNA_def_property(srna, "pie_interaction_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_ui_text(prop, "Interaction Type", "Pie menus use a drag/release or click style");
- RNA_def_property_enum_items(prop, pie_styles);
-
prop = RNA_def_property(srna, "pie_initial_timeout", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Recenter Timeout", "Pie menus will use the initial mouse position as center for this amount of time (in 1/100ths of sec)");
More information about the Bf-blender-cvs
mailing list