diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-07-28 06:02:03 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-07-28 06:08:28 +0300 |
commit | ed19781a2a286540c1f4939258e3d7e96e9ab18c (patch) | |
tree | dea42f1cfea90860ec9595b73ea4dd34183e40a1 | |
parent | 6ad75949b952d7a7911ae91ebc46006203c0da4f (diff) |
Fix T77951: Remove duplicate outliner menu entries
Move the common entries (View and Area) into a static method to be
called from other menus to avoid duplicating the New Collection and ID
Paste operators.
-rw-r--r-- | release/scripts/startup/bl_ui/space_outliner.py | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index aa4d0b94b7f..5a54d4ca2d8 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -107,6 +107,14 @@ class OUTLINER_MT_editor_menus(Menu): class OUTLINER_MT_context_menu(Menu): bl_label = "Outliner Context Menu" + @staticmethod + def draw_common_operators(layout): + layout.menu("OUTLINER_MT_context_menu_view") + + layout.separator() + + layout.menu("INFO_MT_area") + def draw(self, context): space = context.space_data @@ -116,11 +124,7 @@ class OUTLINER_MT_context_menu(Menu): OUTLINER_MT_collection_new.draw_without_context_menu(context, layout) layout.separator() - layout.menu("OUTLINER_MT_context_menu_view") - - layout.separator() - - layout.menu("INFO_MT_area") + OUTLINER_MT_context_menu.draw_common_operators(layout) class OUTLINER_MT_context_menu_view(Menu): @@ -242,7 +246,7 @@ class OUTLINER_MT_collection(Menu): layout.separator() - OUTLINER_MT_context_menu.draw(self, context) + OUTLINER_MT_context_menu.draw_common_operators(layout) class OUTLINER_MT_collection_new(Menu): @@ -250,7 +254,7 @@ class OUTLINER_MT_collection_new(Menu): @staticmethod def draw_without_context_menu(context, layout): - layout.operator("outliner.collection_new", text="New Collection").nested = False + layout.operator("outliner.collection_new", text="New Collection").nested = True layout.operator("outliner.id_paste", text="Paste Data-Blocks", icon='PASTEDOWN') def draw(self, context): @@ -260,7 +264,7 @@ class OUTLINER_MT_collection_new(Menu): layout.separator() - OUTLINER_MT_context_menu.draw(self, context) + OUTLINER_MT_context_menu.draw_common_operators(layout) class OUTLINER_MT_object(Menu): @@ -303,11 +307,15 @@ class OUTLINER_MT_object(Menu): layout.operator("outliner.id_operation", text="Unlink").type = 'UNLINK' layout.separator() + layout.operator("outliner.collection_new", text="New Collection").nested = True + + layout.separator() + layout.operator_menu_enum("outliner.id_operation", "type", text="ID Data") layout.separator() - OUTLINER_MT_context_menu.draw(self, context) + OUTLINER_MT_context_menu.draw_common_operators(layout) class OUTLINER_PT_filter(Panel): |