[3.x] Add support for partial custom editor themes #51648
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.
This allows custom editor themes to be incomplete by merging them with the generated theme. This ensures that every theme item expected by the editor exists in some form, and allows custom themes to be more granular. For example:
This result is achieved with a theme resource that looks something like this:
This should address problems like the one shown in #51414. This might also be useful for merging the default theme and the custom project theme for the projects made with Godot so there is less time spent on lookups, but that's a story for another time.
This also removes unnecessary theme operations in the canvas item editor plugin. It was the only place in the engine that relied on copying the theme, which is completely unnecessary. From my superficial testing the operation took 630-640 microseconds and now takes 20. This only happens once, as the editor is created, but it may remove some hitching for some users, I think. Either way, the theming code is better now, plus the styling applied can now be customized with the editor theme.