diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-23 20:58:54 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-23 21:02:08 +0300 |
commit | 34ebf6f82c4a375feb3c5260597042ff41adc7b5 (patch) | |
tree | d19e93daad6b4ab67e3c8a08e6544ab839e7340e /release/scripts/startup/bl_ui/space_topbar.py | |
parent | 1de3ae7e427eace696b760fe6fa298157ee7c544 (diff) |
Workspaces: move delete to right click menu, instead of X on tab.
These are not intended to be closed as often as e.g. browser tabs, they are
intended to be more persistent and accidental closing should be avoided.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_topbar.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 881d3db8a4c..8bf8e40d74e 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -47,8 +47,8 @@ class TOPBAR_HT_upper_bar(Header): if not screen.show_fullscreen: layout.template_ID_tabs( window, "workspace", - new="workspace.workspace_add_menu", - unlink="workspace.workspace_delete", + new="workspace.add_menu", + menu="TOPBAR_MT_workspace_menu", ) else: layout.operator( @@ -622,11 +622,23 @@ class TOPBAR_MT_window_specials(Menu): layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES') +class TOPBAR_MT_workspace_menu(Menu): + bl_label = "Workspace" + + def draw(self, context): + layout = self.layout + + layout.operator("workspace.duplicate", text="Duplicate") + if len(bpy.data.workspaces) > 1: + layout.operator("workspace.delete", text="Delete") + + classes = ( TOPBAR_HT_upper_bar, TOPBAR_HT_lower_bar, TOPBAR_MT_file_specials, TOPBAR_MT_window_specials, + TOPBAR_MT_workspace_menu, INFO_MT_editor_menus, INFO_MT_file, INFO_MT_file_import, |