[Bf-blender-cvs] [4965af1b7aa] master: UI: add 'App' menu besides the 'File' menu

Campbell Barton noreply at git.blender.org
Wed May 15 13:17:34 CEST 2019


Commit: 4965af1b7aa60466f6f8842a6f77a0d9b2cb72ac
Author: Campbell Barton
Date:   Wed May 15 21:05:51 2019 +1000
Branches: master
https://developer.blender.org/rB4965af1b7aa60466f6f8842a6f77a0d9b2cb72ac

UI: add 'App' menu besides the 'File' menu

This uses the Blender icon that previously activated the splash.

Menu items which apply to the application are located here:
startup file, app templates & preferences.

===================================================================

M	release/scripts/startup/bl_ui/space_topbar.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 509c5bae355..22fc099fca2 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -38,7 +38,7 @@ class TOPBAR_HT_upper_bar(Header):
         window = context.window
         screen = context.screen
 
-        layout.operator("wm.splash", text="", icon='BLENDER', emboss=False)
+        layout.menu("TOPBAR_MT_app", text="", icon='BLENDER')
 
         TOPBAR_MT_editor_menus.draw_collapsible(context, layout)
 
@@ -167,32 +167,17 @@ class TOPBAR_MT_editor_menus(Menu):
         layout.menu("TOPBAR_MT_help")
 
 
-class TOPBAR_MT_file(Menu):
-    bl_label = "File"
+class TOPBAR_MT_app(Menu):
+    bl_label = "Application"
 
     def draw(self, context):
         layout = self.layout
         prefs = context.preferences
 
-        layout.operator_context = 'INVOKE_AREA'
-        layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
-        layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
-        layout.menu("TOPBAR_MT_file_open_recent")
-        layout.operator("wm.revert_mainfile")
-        layout.operator("wm.recover_last_session")
-        layout.operator("wm.recover_auto_save", text="Recover Auto Save...")
+        layout.operator("wm.splash", icon='BLENDER')
 
         layout.separator()
 
-        layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
-        layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
-
-        layout.operator_context = 'INVOKE_AREA'
-        layout.operator("wm.save_as_mainfile", text="Save As...")
-        layout.operator_context = 'INVOKE_AREA'
-        layout.operator("wm.save_as_mainfile", text="Save Copy...").copy = True
-
-        layout.separator()
         layout.operator_context = 'INVOKE_AREA'
 
         if any(bpy.utils.app_template_paths()):
@@ -223,6 +208,42 @@ class TOPBAR_MT_file(Menu):
 
         layout.separator()
 
+        layout.operator("screen.userpref_show", text="Preferences...", icon='PREFERENCES')
+
+        layout.separator()
+
+        layout.operator_context = 'EXEC_AREA'
+        if bpy.data.is_dirty:
+            layout.operator_context = 'INVOKE_SCREEN'  # quit dialog
+        layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
+
+
+class TOPBAR_MT_file(Menu):
+    bl_label = "File"
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator_context = 'INVOKE_AREA'
+        layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
+        layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
+        layout.menu("TOPBAR_MT_file_open_recent")
+        layout.operator("wm.revert_mainfile")
+        layout.operator("wm.recover_last_session")
+        layout.operator("wm.recover_auto_save", text="Recover Auto Save...")
+
+        layout.separator()
+
+        layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
+        layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
+
+        layout.operator_context = 'INVOKE_AREA'
+        layout.operator("wm.save_as_mainfile", text="Save As...")
+        layout.operator_context = 'INVOKE_AREA'
+        layout.operator("wm.save_as_mainfile", text="Save Copy...").copy = True
+
+        layout.separator()
+
         layout.operator_context = 'INVOKE_AREA'
         layout.operator("wm.link", text="Link...", icon='LINK_BLEND')
         layout.operator("wm.append", text="Append...", icon='APPEND_BLEND')
@@ -237,13 +258,6 @@ class TOPBAR_MT_file(Menu):
 
         layout.menu("TOPBAR_MT_file_external_data")
 
-        layout.separator()
-
-        layout.operator_context = 'EXEC_AREA'
-        if bpy.data.is_dirty:
-            layout.operator_context = 'INVOKE_SCREEN'  # quit dialog
-        layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
-
 
 class TOPBAR_MT_file_new(Menu):
     bl_label = "New File"
@@ -448,10 +462,6 @@ class TOPBAR_MT_edit(Menu):
         tool_settings = context.tool_settings
         layout.prop(tool_settings, "lock_object_mode")
 
-        layout.separator()
-
-        layout.operator("screen.userpref_show", text="Preferences...", icon='PREFERENCES')
-
 
 class TOPBAR_MT_window(Menu):
     bl_label = "Window"
@@ -713,6 +723,7 @@ classes = (
     TOPBAR_MT_file_context_menu,
     TOPBAR_MT_workspace_menu,
     TOPBAR_MT_editor_menus,
+    TOPBAR_MT_app,
     TOPBAR_MT_file,
     TOPBAR_MT_file_new,
     TOPBAR_MT_templates_more,



More information about the Bf-blender-cvs mailing list