Skip to content
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

Add conversion for common Theme Overrides #74624

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

Maran23
Copy link
Contributor

@Maran23 Maran23 commented Mar 8, 2023

Fixes: #66052
This PR adds conversion for the most commonly used theme overrides.
This includes:

  • Styles (StyleBoxes)
  • Icons
  • Font colors
  • Spacing, Separation, Offsets

-> Margins, StyleBoxes etc. will still work after the migration.

@YuriSizov
Copy link
Contributor

Can't we just rename the sections instead of listing some specific and arbitrary properties?

@Maran23
Copy link
Contributor Author

Maran23 commented Mar 8, 2023

Can't we just rename the sections instead of listing some specific and arbitrary properties?

Unfortunately not in all cases.
Sometimes it is as simple as:
custom_styles/normal -> theme_override_styles/normal
and sometimes more tricky:
custom_colors/font_outline_modulate -> theme_override_colors/font_outline_color

And using e.g. custom_styles/ in front of the properties will make sure we really just rename the Theme Override property and not just an arbitrary named variable.

@YuriSizov
Copy link
Contributor

What I mean is, can't we rename custom_*/ to theme_override_*/, before doing specific renames?

@Maran23
Copy link
Contributor Author

Maran23 commented Mar 8, 2023

What I mean is, can't we rename custom_*/ to theme_override_*/, before doing specific renames?

Ahh. Yeah, that should be possible. Then the theme conversion needs two steps:

  1. Replace custom_*/ with theme_override_*/
  2. Rename the properties which were renamed in Godot 4

I can check that out tomorrow. :)

@Maran23
Copy link
Contributor Author

Maran23 commented Mar 9, 2023

What I mean is, can't we rename custom_*/ to theme_override_*/, before doing specific renames?

Done. I still opted for the safer approach, so we really won't be converting any unrelated properties/variables.

@YuriSizov YuriSizov merged commit 3bd5ba3 into godotengine:master Mar 15, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.1.

@Maran23 Maran23 deleted the converter-theme-overrides branch August 4, 2023 18:03
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.

Converter 3 -> 4: the "Theme Overrides" properties is not migrated
3 participants