diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2019-04-16 14:12:28 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2019-04-16 14:16:04 +0300 |
commit | 423d9086e64e5f9bfb175f95e17ca426567af17d (patch) | |
tree | 658799c63b90da2a3b95425b7b3458758bdff308 /source/blender/windowmanager/intern | |
parent | 2e3bc99590d13dc5a1ae2f9f574371f99b0677d6 (diff) |
Fix T63429: Random deselect function lost
Add back the ability to choose the select operation for random select.
Now we allow the operator to specify if the select operation should be
visible in the GUI or not.
Reviewed By: Brecht
Differential Revision: http://developer.blender.org/D4665
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operator_props.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index 0e4d8a7bf71..55b45adbe2d 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -140,14 +140,18 @@ void WM_operator_properties_filesel( } static void wm_operator_properties_select_action_ex(wmOperatorType *ot, int default_action, - const EnumPropertyItem *select_actions) + const EnumPropertyItem *select_actions, + bool hide_gui) { PropertyRNA *prop; prop = RNA_def_enum(ot->srna, "action", select_actions, default_action, "Action", "Selection action to execute"); - RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); + + if (hide_gui) { + RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); + } } -void WM_operator_properties_select_action(wmOperatorType *ot, int default_action) +void WM_operator_properties_select_action(wmOperatorType *ot, int default_action, bool hide_gui) { static const EnumPropertyItem select_actions[] = { {SEL_TOGGLE, "TOGGLE", 0, "Toggle", "Toggle selection for all elements"}, @@ -157,13 +161,13 @@ void WM_operator_properties_select_action(wmOperatorType *ot, int default_action {0, NULL, 0, NULL, NULL}, }; - wm_operator_properties_select_action_ex(ot, default_action, select_actions); + wm_operator_properties_select_action_ex(ot, default_action, select_actions, hide_gui); } /** * only SELECT/DESELECT */ -void WM_operator_properties_select_action_simple(wmOperatorType *ot, int default_action) +void WM_operator_properties_select_action_simple(wmOperatorType *ot, int default_action, bool hide_gui) { static const EnumPropertyItem select_actions[] = { {SEL_SELECT, "SELECT", 0, "Select", "Select all elements"}, @@ -171,7 +175,7 @@ void WM_operator_properties_select_action_simple(wmOperatorType *ot, int default {0, NULL, 0, NULL, NULL}, }; - wm_operator_properties_select_action_ex(ot, default_action, select_actions); + wm_operator_properties_select_action_ex(ot, default_action, select_actions, hide_gui); } /** @@ -187,7 +191,7 @@ void WM_operator_properties_select_random(wmOperatorType *ot) ot->srna, "seed", 0, 0, INT_MAX, "Random Seed", "Seed for the random number generator", 0, 255); - WM_operator_properties_select_action_simple(ot, SEL_SELECT); + WM_operator_properties_select_action_simple(ot, SEL_SELECT, false); } int WM_operator_properties_select_random_seed_increment_get(wmOperator *op) @@ -206,7 +210,7 @@ int WM_operator_properties_select_random_seed_increment_get(wmOperator *op) void WM_operator_properties_select_all(wmOperatorType *ot) { - WM_operator_properties_select_action(ot, SEL_TOGGLE); + WM_operator_properties_select_action(ot, SEL_TOGGLE, true); } void WM_operator_properties_border(wmOperatorType *ot) |