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:
authorCampbell Barton <ideasman42@gmail.com>2019-05-24 08:46:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-24 08:48:08 +0300
commit7dd888c0cf4039d3224863a7f2d235674d321614 (patch)
treeaade5973ede02058207b2fb401427f1b5351fff7 /source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c
parent911116e1ba5d5cb63e74c32ba257bc665831c853 (diff)
Keymap: share 3D view transform keymaps
While internally these are separate gizmos, there is no reason to have a keymaps for each. Also prefix the gizmo with "3D View" since there are other kinds of transform gizmos.
Diffstat (limited to 'source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c')
-rw-r--r--source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c
index 85ebd2baefa..68020c736d8 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c
@@ -680,21 +680,30 @@ static wmKeyMap *gizmogroup_tweak_modal_keymap(wmKeyConfig *keyconf, const char
}
/**
- * Common default keymap for gizmo groups
+ * Common default keymap for gizmo groups.
+ *
+ * \param name: Typically #wmGizmoGroupType.name.
*/
-wmKeyMap *WM_gizmogroup_keymap_common(const wmGizmoGroupType *gzgt, wmKeyConfig *config)
+wmKeyMap *WM_gizmogroup_keymap_common_with_name(const wmGizmoGroupType *gzgt,
+ wmKeyConfig *config,
+ const char *name)
{
/* Use area and region id since we might have multiple gizmos
* with the same name in different areas/regions. */
wmKeyMap *km = WM_keymap_ensure(
- config, gzgt->name, gzgt->gzmap_params.spaceid, gzgt->gzmap_params.regionid);
+ config, name, gzgt->gzmap_params.spaceid, gzgt->gzmap_params.regionid);
WM_keymap_add_item(km, "GIZMOGROUP_OT_gizmo_tweak", LEFTMOUSE, KM_PRESS, KM_ANY, 0);
- gizmogroup_tweak_modal_keymap(config, gzgt->name);
+ gizmogroup_tweak_modal_keymap(config, name);
return km;
}
+wmKeyMap *WM_gizmogroup_keymap_common(const wmGizmoGroupType *gzgt, wmKeyConfig *config)
+{
+ return WM_gizmogroup_keymap_common_with_name(gzgt, config, gzgt->name);
+}
+
/**
* Variation of #WM_gizmogroup_keymap_common but with keymap items for selection
*/