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:
authorYevgeny Makarov <jenkm>2020-03-09 21:53:59 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-03-09 22:18:11 +0300
commit04e9ba7169c0889cce28171a55e81ea983d1dd79 (patch)
tree14972a1055b92b549e56aed31887b60e00c77d99 /release/scripts
parent2d8d30e17b560598dc29de626c6a605ac1a99b94 (diff)
UI: add menus for preferences editor
This only applies to the case where preferences are opened as an editor in a workspace, not with Edit > Preferences in a new window. Differential Revision: https://developer.blender.org/D7001
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py36
1 files changed, 27 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 77e642f5e1f..6aa0f51c55c 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -37,18 +37,13 @@ class USERPREF_HT_header(Header):
def draw_buttons(layout, context):
prefs = context.preferences
- layout.scale_x = 1.0
- layout.scale_y = 1.0
layout.operator_context = 'EXEC_AREA'
- row = layout.row()
- row.menu("USERPREF_MT_save_load", text="", icon='COLLAPSEMENU')
-
if prefs.use_preferences_save and (not bpy.app.use_userpref_skip_save_on_exit):
pass
else:
# Show '*' to let users know the preferences have been modified.
- row.operator(
+ layout.operator(
"wm.save_userpref",
text="Save Preferences{:s}".format(" *" if prefs.is_dirty else ""),
)
@@ -59,7 +54,10 @@ class USERPREF_HT_header(Header):
layout.template_header()
+ USERPREF_MT_editor_menus.draw_collapsible(context, layout)
+
layout.separator_spacer()
+
self.draw_buttons(layout, context)
@@ -84,6 +82,25 @@ class USERPREF_PT_navigation_bar(Panel):
col.prop(prefs, "active_section", expand=True)
+class USERPREF_MT_editor_menus(Menu):
+ bl_idname = "USERPREF_MT_editor_menus"
+ bl_label = ""
+
+ def draw(self, _context):
+ layout = self.layout
+ layout.menu("USERPREF_MT_view")
+ layout.menu("USERPREF_MT_save_load", text="Preferences")
+
+
+class USERPREF_MT_view(Menu):
+ bl_label = "View"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.menu("INFO_MT_area")
+
+
class USERPREF_MT_save_load(Menu):
bl_label = "Save & Load"
@@ -125,11 +142,10 @@ class USERPREF_PT_save_preferences(Panel):
return False
def draw(self, context):
- layout = self.layout
+ layout = self.layout.row()
layout.operator_context = 'EXEC_AREA'
- layout.scale_x = 1.3
- layout.scale_y = 1.3
+ layout.menu("USERPREF_MT_save_load", text="", icon='COLLAPSEMENU')
USERPREF_HT_header.draw_buttons(layout, context)
@@ -2128,6 +2144,8 @@ classes = (
USERPREF_HT_header,
USERPREF_PT_navigation_bar,
USERPREF_PT_save_preferences,
+ USERPREF_MT_editor_menus,
+ USERPREF_MT_view,
USERPREF_MT_save_load,
USERPREF_PT_interface_display,