Skip to content

Fix some Text Editor theme issues and clean up #108463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kitbdev
Copy link
Contributor

@kitbdev kitbdev commented Jul 10, 2025

Changes

  • Fixed Reload Theme, it did not seem to work at all. It was probably broken since Use check_changed_settings_in_group() everywhere #69032, since EditorSettings::load_text_editor_theme() emitted the signal without marking the settings as changed, but it could be from earlier.
  • Removed Save Theme menu option. It was not very useful because if you are on a loaded theme, then the file content is already the same. And if you change any theme setting in EditorSettings it switches to Custom theme which always directs you to the Save Theme as... option.
  • Import theme now also immediately switches to the new theme. This is because if you don't know that it is copying a file to the themes directory, it gave no feedback that it worked.
  • Moved the saving and importing to the ScriptEditor with the options, they don't need to be in the EditorSettings.
  • When saving a new text editor theme it no longer sets the initial value for the color_theme, it removed the revert button for it unnecessarily and it didn't persist after restart anyway.
  • Switched to toasters instead of warning boxes, and added more helpful messages when importing or saving fails.
  • Moved the loading to the EditorThemeManager. If the theme loading fails (eg. if you delete while EditorSettings is open) then there will now be an error.
  • Loaded themes now set the initial values, so they won't have revert buttons and now act more like the built in themes do.
  • Project override for the color_theme now works. Note that if you do override it if you want to change any other colors, you will need to manually set the override to Custom or override the colors, as the EditorSettings values for them will be reverted.
  • Moved the ScriptEditor ThemeMenu enum into its MenuOptions enum since values from both are used in the same switch statement and removing THEME_SAVE made the THEME_SAVE_AS option have the same value as another.
  • Moved setting definitions out of GDScript highlighter.

Documentation

  • Added documentation for the GDScript only syntax highlighter editor settings. I don't think we can only have them for GDScript builds, so its just always available now. The comment markers part could be used in other languages, but it isn't yet.
  • In the GDScript syntax highlighter color descriptions, I use [codeblock] instead of [code]. This is because it has syntax highlighting in the editor, and it is useful to see the effects right there.

@kitbdev kitbdev added this to the 4.5 milestone Jul 10, 2025
@kitbdev kitbdev requested review from a team as code owners July 10, 2025 01:07
@Mickeon
Copy link
Member

Mickeon commented Jul 10, 2025

There was a PR by @dalexeev that tackled roughly the same part of the documentation to implement descriptions for the comment markers. I cannot find it at the moment.

Comment on lines +1565 to +1567
[codeblock]
@export
[/codeblock]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this kind of code block is particularly necessary for a bunch of reasons:

  • In the editor, it's not hard to confront between an open tab and the editor settings. Looking at the tooltip every time is comparatively cumbersome.
  • It takes a lot of space for an example that can be written in the previous line.
  • The need to write this speaks for a lack of a better way to visualize it with, say, an editor section specialized in setting up a custom theme.

Copy link
Contributor Author

@kitbdev kitbdev Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured it try it. In that case I can change them all to be:
The GDScript syntax highlighter text color for annotations (e.g. [code]@export[/code]).

Another option is adding optional GDScript syntax highlighting to [code] blocks, but that can be considered later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants