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:
authorJulian Eisel <julian@blender.org>2020-08-03 18:18:15 +0300
committerJulian Eisel <julian@blender.org>2020-08-03 19:26:06 +0300
commit10590b0500c95d124d00f95e5eefbc7107e3ba5e (patch)
tree5e31d644e61db9f832ed9bd62b27248799965c96 /release/scripts
parent3593dff147ae2a13c07e6338cb0d6a71218596b1 (diff)
Fix missing shortcut indicators and crash on shortcut change
Fixes T78346. The shortcut display and change code is context sensitive. To make it work correctly the context needs to be set properly. When executing operators from the dropdowns, the active region is the header, but the shortcut handlers are set for the main region. So make sure that is used instead. This also sets the main region active for context menu operators, where this issue shouldn't be present. Doing it anyway shouldn't hurt though and fixes this issue in case somebody displays the context menu in the header as dropdown too.
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/startup/bl_ui/space_graph.py2
-rw-r--r--release/scripts/startup/bl_ui/space_node.py2
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py20
3 files changed, 12 insertions, 12 deletions
diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py
index c251d55714f..078b1c9ff38 100644
--- a/release/scripts/startup/bl_ui/space_graph.py
+++ b/release/scripts/startup/bl_ui/space_graph.py
@@ -293,7 +293,7 @@ class GRAPH_MT_key(Menu):
# Using the modal operation doesn't make sense for this variant
# as we do not have a modal mode for it, so just execute it.
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("graph.decimate", text="Decimate (Allowed Change)").mode = 'ERROR'
layout.operator_context = operator_context
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index b5926692324..f2b0ba28d99 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -433,7 +433,7 @@ class NODE_MT_context_menu(Menu):
layout.operator("node.delete")
layout.operator("node.clipboard_copy", text="Copy")
layout.operator("node.clipboard_paste", text="Paste")
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("node.delete_reconnect")
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 0a1be2dc698..e73dc0e3b7e 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -986,7 +986,7 @@ class VIEW3D_MT_transform_base(Menu):
if context.mode != 'OBJECT':
layout.operator("transform.vertex_warp", text="Warp")
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("transform.vertex_random", text="Randomize").offset = 0.1
layout.operator_context = 'INVOKE_REGION_WIN'
@@ -2058,7 +2058,7 @@ class VIEW3D_MT_edit_metaball_context_menu(Menu):
layout.separator()
# Remove
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("mball.delete_metaelems", text="Delete")
@@ -2333,7 +2333,7 @@ class VIEW3D_MT_object(Menu):
layout.separator()
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("object.delete", text="Delete").use_global = False
layout.operator("object.delete", text="Delete Global").use_global = True
@@ -2597,7 +2597,7 @@ class VIEW3D_MT_object_context_menu(Menu):
layout.separator()
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("object.delete", text="Delete").use_global = False
@@ -2683,7 +2683,7 @@ class VIEW3D_MT_object_parent(Menu):
layout.separator()
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("object.parent_no_inverse_set")
layout.operator_context = operator_context_default
@@ -2774,7 +2774,7 @@ class VIEW3D_MT_make_single_user(Menu):
def draw(self, _context):
layout = self.layout
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
props = layout.operator("object.make_single_user", text="Object")
props.object = True
@@ -3714,7 +3714,7 @@ class VIEW3D_MT_edit_mesh_context_menu(Menu):
col.operator("transform.shrink_fatten", text="Shrink/Fatten")
col.operator("transform.shear", text="Shear")
col.operator("transform.vert_slide", text="Slide Vertices")
- col.operator_context = 'EXEC_DEFAULT'
+ col.operator_context = 'EXEC_REGION_WIN'
col.operator("transform.vertex_random", text="Randomize Vertices").offset = 0.1
col.operator("mesh.vertices_smooth", text="Smooth Vertices").factor = 0.5
col.operator_context = 'INVOKE_REGION_WIN'
@@ -3941,7 +3941,7 @@ class VIEW3D_MT_edit_mesh_vertices(Menu):
layout.separator()
layout.operator("transform.vert_slide", text="Slide Vertices")
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("mesh.vertices_smooth", text="Smooth Vertices").factor = 0.5
layout.operator("mesh.vertices_smooth_laplacian", text="Smooth Vertices (Laplacian)")
layout.operator_context = 'INVOKE_REGION_WIN'
@@ -4195,7 +4195,7 @@ class VIEW3D_MT_edit_mesh_normals(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("transform.rotate_normal", text="Rotate...")
layout.operator("mesh.point_normals", text="Point to Target...")
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("mesh.merge_normals", text="Merge")
layout.operator("mesh.split_normals", text="Split")
@@ -4662,7 +4662,7 @@ class VIEW3D_MT_edit_meta(Menu):
layout.menu("VIEW3D_MT_edit_meta_showhide")
- layout.operator_context = 'EXEC_DEFAULT'
+ layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("mball.delete_metaelems", text="Delete")