Page MenuHome
Paste P1070

Auto Save UI
ActivePublic

Authored by Yevgeny Makarov (jenkm) on Aug 17 2019, 10:08 AM.
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index ce4a6fb835e..01f33dcc9f3 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -34,22 +34,28 @@ 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'
+ header = True if context.region.type == 'HEADER' else False
+
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
+ if not header:
+ row.menu("USERPREF_MT_save_load", text="", icon='COLLAPSEMENU')
+
+ if prefs.use_preferences_save:
+ row.label(text="Auto Save: ON!")
else:
# Show '*' to let users know the preferences have been modified.
+ text = "Save Preferences{:s}" if header else "Save{:s}"
row.operator(
"wm.save_userpref",
- text="Save Preferences{:s}".format(" *" if prefs.is_dirty else ""),
+ text=text.format(" *" if prefs.is_dirty else ""),
)
+ if header:
+ row.menu("USERPREF_MT_save_load", text="", icon='COLLAPSEMENU')
+
def draw(self, context):
layout = self.layout
layout.operator_context = 'EXEC_AREA'