diff options
author | Luca Rood <dev@lucarood.com> | 2022-08-18 16:26:30 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2022-08-18 16:26:30 +0300 |
commit | 9a65dca37c90077bb61d1545dea1ef9b1f39758e (patch) | |
tree | 4b850d730a5ebc0914dddde9e5b10cf43a845bfb /release | |
parent | a7652bf2f7fb4f2b6c991f7596fa2b4d240f6068 (diff) | |
parent | 8a799b00f8fa28433ba44cfec09757f77a46ae0d (diff) |
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/__init__.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index c4e3df469b7..a57a2cc5a4c 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -239,3 +239,23 @@ class UI_MT_list_item_context_menu(bpy.types.Menu): bpy.utils.register_class(UI_MT_list_item_context_menu) + + +class UI_MT_button_context_menu(bpy.types.Menu): + """ + UI button context menu definition. Scripts can append/prepend this to + add own operators to the context menu. They must check context though, so + their items only draw in a valid context and for the correct buttons. + """ + + bl_label = "List Item" + bl_idname = "UI_MT_button_context_menu" + + def draw(self, context): + # Draw menu entries created with the legacy `WM_MT_button_context` class. + # This is deprecated, and support will be removed in a future release. + if hasattr(bpy.types, "WM_MT_button_context"): + self.layout.menu_contents("WM_MT_button_context") + + +bpy.utils.register_class(UI_MT_button_context_menu) |