Fix custom Text Editor theme changes on reload #107918
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the EditorSettings loads defaults, I replaced the call to
_load_godot2_text_editor_theme
withEDITOR_SETTING*
, this is so the text editor theme settings always saves to the editor settings file, just like the editor theme settings does. This is important when loading and the preset is Custom.The
_load_godot2_text_editor_theme
should probably be moved to the editor theme manager in the future, for now I left it as is since the text editor theme loading still uses it.I wanted to have the EditorSettingsDialog immediately update so the revert icons show, but I ran into an issue with the ColorPickerButton completely freezing the dialog if it was open while reloading. As before, they only reload when reopening the category or the dialog. It shouldn't cause any issues that they aren't immediately updated, since it is just for the revert buttons.
The initial values for the Custom preset are now the current Default theme. So if you were on Godot 2 and change to Custom, all of the values can be reverted, and the same from Default if the editor's base color changes, since Default changes based on it.