UI: don't gray out "Revert to Saved Preferences" with factory startup
This made it seem as if it wasn't possible to load from saved preferences when running Blender with '--factory-startup'. This isn't a perfect solution as loading the saved preferences doesn't clear `bpy.app.factory_startup`. Even so, it's better not to gray out a menu item which is functional.
This commit is contained in:
@@ -109,7 +109,10 @@ class USERPREF_MT_save_load(Menu):
|
||||
if prefs.use_preferences_save:
|
||||
layout.operator("wm.save_userpref", text="Save Preferences")
|
||||
sub_revert = layout.column(align=True)
|
||||
sub_revert.active = prefs.is_dirty
|
||||
# NOTE: regarding `factory_startup`. To correctly show the active state of this menu item,
|
||||
# the user preferences themselves would need to have a `factory_startup` state.
|
||||
# Since showing an active menu item whenever factory-startup is used is not such a problem, leave this as-is.
|
||||
sub_revert.active = prefs.is_dirty or bpy.app.factory_startup
|
||||
sub_revert.operator("wm.read_userpref", text="Revert to Saved Preferences")
|
||||
|
||||
layout.operator_context = 'INVOKE_AREA'
|
||||
|
||||
Reference in New Issue
Block a user