godot icon indicating copy to clipboard operation
godot copied to clipboard

Add conversion for common Theme Overrides

Open Maran23 opened this issue 1 year ago • 5 comments

Fixes: https://github.com/godotengine/godot/issues/66052 This PR adds conversion for the most commonly used theme overrides. This includes:

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

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

Maran23 avatar Mar 08 '23 22:03 Maran23

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

YuriSizov avatar Mar 08 '23 22:03 YuriSizov

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.

Maran23 avatar Mar 08 '23 22:03 Maran23

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

YuriSizov avatar Mar 08 '23 22:03 YuriSizov

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 avatar Mar 08 '23 22:03 Maran23

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.

Maran23 avatar Mar 09 '23 21:03 Maran23

Thanks!

YuriSizov avatar Mar 15 '23 13:03 YuriSizov

Cherry-picked for 4.0.1.

YuriSizov avatar Mar 16 '23 15:03 YuriSizov