Skip to content

Commit 6b25736

Browse files
committed
Fix deleting every empty theme override
1 parent 750640c commit 6b25736

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

editor/plugins/theme_editor_plugin.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,15 +1588,11 @@ void ThemeItemEditorDialog::_add_theme_item(Theme::DataType p_data_type, String
15881588

15891589
void ThemeItemEditorDialog::_remove_theme_type(const String &p_theme_type) {
15901590
Ref<Theme> old_snapshot = edited_theme->duplicate();
1591-
Ref<Theme> new_snapshot = edited_theme->duplicate();
15921591

15931592
EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton();
15941593
ur->create_action(TTR("Remove Theme Type"));
15951594

1596-
new_snapshot->remove_type(p_theme_type);
1597-
1598-
ur->add_do_method(*edited_theme, "clear");
1599-
ur->add_do_method(*edited_theme, "merge_with", new_snapshot);
1595+
ur->add_do_method(*edited_theme, "remove_type", p_theme_type);
16001596
// If the type was empty, it cannot be restored with merge, but thankfully we can fake it.
16011597
ur->add_undo_method(*edited_theme, "add_type", p_theme_type);
16021598
ur->add_undo_method(*edited_theme, "merge_with", old_snapshot);

0 commit comments

Comments
 (0)