From 6b257364bdcafefc291b7127a383aee7c15392c2 Mon Sep 17 00:00:00 2001 From: Jayden Sipe Date: Fri, 14 Feb 2025 02:02:12 -0500 Subject: [PATCH] Fix deleting every empty theme override --- editor/plugins/theme_editor_plugin.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index ca0372929d..af9fd3bc26 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -1588,15 +1588,11 @@ void ThemeItemEditorDialog::_add_theme_item(Theme::DataType p_data_type, String void ThemeItemEditorDialog::_remove_theme_type(const String &p_theme_type) { Ref old_snapshot = edited_theme->duplicate(); - Ref new_snapshot = edited_theme->duplicate(); EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton(); ur->create_action(TTR("Remove Theme Type")); - new_snapshot->remove_type(p_theme_type); - - ur->add_do_method(*edited_theme, "clear"); - ur->add_do_method(*edited_theme, "merge_with", new_snapshot); + ur->add_do_method(*edited_theme, "remove_type", p_theme_type); // If the type was empty, it cannot be restored with merge, but thankfully we can fake it. ur->add_undo_method(*edited_theme, "add_type", p_theme_type); ur->add_undo_method(*edited_theme, "merge_with", old_snapshot);