Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin <Poulpator>2020-03-02 18:05:59 +0300
committerJulian Eisel <eiseljulian@gmail.com>2020-03-02 18:07:34 +0300
commit7b8db971d42f6d6b7b1c74959758266ce8c859e0 (patch)
tree1ba8b885eaa68a50cdfd4ca37a229ae46c21e00a /source/blender/windowmanager/intern/wm_operator_props.c
parent51bce18b6f97dd6c21899e43f4ee4491d0061e92 (diff)
Cleanup: Use generics properties for arrow keys navigation (walk-select)
This patch refactors arrow keys navigation to move properties and enum to generic ED_select_utils.h and property to WM_operator_properties_select_walk_direction() No functional change Reviewed By: Julian Eisel Differential Revision: https://developer.blender.org/D4771
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operator_props.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operator_props.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c
index 4c0b35a65e5..676ce655a42 100644
--- a/source/blender/windowmanager/intern/wm_operator_props.c
+++ b/source/blender/windowmanager/intern/wm_operator_props.c
@@ -399,6 +399,25 @@ void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
+void WM_operator_properties_select_walk_direction(wmOperatorType *ot)
+{
+ static const EnumPropertyItem direction_items[] = {
+ {UI_SELECT_WALK_UP, "UP", 0, "Prev", ""},
+ {UI_SELECT_WALK_DOWN, "DOWN", 0, "Next", ""},
+ {UI_SELECT_WALK_LEFT, "LEFT", 0, "Left", ""},
+ {UI_SELECT_WALK_RIGHT, "RIGHT", 0, "Right", ""},
+ {0, NULL, 0, NULL, NULL},
+ };
+ PropertyRNA *prop;
+ prop = RNA_def_enum(ot->srna,
+ "direction",
+ direction_items,
+ 0,
+ "Walk Direction",
+ "Select/Deselect element in this direction");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+}
+
/**
* Selecting and tweaking items are overlapping operations. Getting both to work without conflicts
* requires special care. See