Open henkehedstrom opened 3 months ago
Default Theme resource is empty. It does not define any value, and if something is not defined, the value is taken from parent theme. Currently there is no way to "discard" a Theme, other than explicitly copying values from default theme.
Default Theme resource is empty. It does not define any value, and if something is not defined, the value is taken from parent theme. Currently there is no way to "discard" a Theme, other than explicitly copying values from default theme.
I see so it only saves diffs compared to the default theme.
How would I explicitly copy values from the default theme. Can I find them somewhere? What if the default theme changes, I need to update my custom default theme then again. I guess a discard function or an option to not inherit themes from parents would be nice.
I guess I could manually set themes on every child that needs a theme aswell. A bit more manual work but then buttons without a theme will work like I want.
In Theme editor there is Import button that allows you to copy values from default theme.
You can also break inheritance chain by enabling top_level in Control (I think), or using non-Control parent. But this makes the node not work in Containers, so it's a rarely feasible solution.
Tested versions
Reproducible in Godot 4.2.2 stable. Tested opening the project in 4.1.2 stable aswell and had the same issue but don't know if it is a good enough test or if I should create everything from scratch.
I used Compatibility mode.
System information
Windows 11
Issue description
I created an HBoxContainer with a theme that made every button green. If I added a button as a child to that container it turned green as expected. If I changed the theme on a child to a theme that made the button red, it turned red. However, when I added a theme that did not alter the button at all (I just made a new theme and saved it with default settings) the button was still green. My new theme did not alter the button.
The picture below is showing an HBoxContainer with the green_theme and then three buttons with different themes. Red and blue buttons have themes that give them their respective colours. The "Default Button" has the theme showed in the theme window in the picture, it should have the default grey colour.
Steps to reproduce
Minimal reproduction project (MRP)
Open the test.tscn and you will see the same as in my screenshot MRP.zip