Theme: reset the theme to the default when removing a preset

It's strange to keep the theme displayed after its removal.
This commit is contained in:
Campbell Barton 2024-04-11 17:43:44 +10:00
parent 962d2ca6a6
commit 182f1746b7

View File

@ -589,6 +589,11 @@ class RemovePresetInterfaceTheme(AddPresetBase, Operator):
def invoke(self, context, event):
return context.window_manager.invoke_confirm(self, event, title="Remove Custom Theme", confirm_text="Delete")
def post_cb(self, context):
# Without this, the name & colors are kept after removing the theme.
# Even though the theme is removed from the list, it's seems like a bug to keep it displayed after removal.
bpy.ops.preferences.reset_default_theme()
class SavePresetInterfaceTheme(AddPresetBase, Operator):
"""Save a custom theme in the preset list"""