-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Allow each control to use a specific custom style defined in the assigned theme #20320
Comments
Intersting though! To answer your question: you are supposed to use stylebox override for this... Theming in godot is very simple. It's basically a dicrionary with objects (styleboxes) which know how to draw rectangles ;) ) thats it. |
But if you convince me, with a very nice implementatiln, and some good arguments, i might do sone work on theming. Planning to do that anyways. (Shader style boxes, theme based dpi setting with inmediate update, better theme loading withou all svg recreating, auto icon upscaling woth bitmap icons...) |
Thanks for the feedback. I'm planning to revisit this issue soon when I'll try to generalize / reorganize what UIs I've made so far in my project. So I'll share it here, if I come up with some ideas regarding the issue. |
I'd love to see this implemented. As a workaround I'm using 4 themes in my game |
The absence of UI styles as described in Godot issue #20320 (godotengine/godot#20320) prevents using a universal theme across the entire menu UI. Instead, I've created four themes for buttons and labels of different sizes. Also fixed another leftover bug from renaming 'Creature' to 'Customer'.
The absence of UI styles as described in Godot issue #20320 (godotengine/godot#20320) prevents using a universal theme across the entire menu UI. Instead, I've created four themes for buttons and labels of different sizes. Also fixed another leftover bug from renaming 'Creature' to 'Customer'.
Closing in favor of godotengine/godot-proposals#850, as feature proposals are now tracked on the Godot proposals repository. |
The absence of UI styles as described in Godot issue #20320 (godotengine/godot#20320) prevents using a universal theme across the entire menu UI. Instead, I've created four themes for buttons and labels of different sizes. Also fixed another leftover bug from renaming 'Creature' to 'Customer'.
Godot version:
master
/ cfcb6e1OS/device including version:
Manjaro Linux 17.1
Issue description: (This issue is a feature request)
When defining an UI theme, sometimes it's needed to make the same type of control to look differently depending on a context.
For example, a
Panel
can have an opaque background normally, but when they are used as a backdrop of a modal dialog, it's maybe necessary to show them with a translucent background.With CSS, such a use case would be covered by declaring a style definition for normal panels and an override for backdrop panels, which can be identified by having a specific CSS class, like
backdrop
:However, in Godot, it seems that there's no clear way to achieve a similar functionality. I can define a theme resource which defines how all panels must look, but if we want to make a certain type of panels to look differently, we need to either create a separate theme, or define a stylebox and set it to individual
Panel
instances.It seems that it's possible to define various custom styles for such controls like
Button
orPanel
, but apparently it's not possible currently, to make each control to use one of those custom styles defined in a theme its using rather than the default one.It'd be better if there is a way to specify that a control belongs to a certain group, i.e.
backdrop
, so it should be rendered differently according to a custom style defined for that context in its associated theme.The text was updated successfully, but these errors were encountered: