-
-
Notifications
You must be signed in to change notification settings - Fork 97
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 getters and setters to control nodes' theme items #2000
Comments
For the record, "Custom" items are called theme items in Godot's GUI system (see the class reference). |
@Calinou . Thanks, I did not know that. I know themes are there but that section is called 'Theme' in the inspector. The 'Custom Styles', 'Custom Fonts', 'Custom Colours', 'Custom Constants' are separate to 'Theme' so I presumed them separate. btw, you do an awesome job maintaining the issues system :) |
Ok, that's good to know, thanks. But there are so many other useful properties hidden by this theming/custom system that require hard-coded string changes, and even this method you provided is still hidden behind a string and an obscure sounding method, making it difficult to document and for people to actually code with. What you've supplied is now a second way of accessing the same property, which kind of makes it sound a bit wrong (as in why are there two different ways of doing the same thing), and there still is no direct way of setting the values. I'm guessing there is a reason for this lack of accessor methods? |
The reason is that they are not real properties. |
Ok, I guess they're not going to change anytime soon to make them more usable or even documented. Seems like there isn't a massive difference between setting these 'themed' properties than say Process Material colours, but this resource is fully kitted out with getters/setters. |
I'm using the built in docs 👍 Maybe you need to look from the perspective of a 'typical' user (I hope I'm one :) ). I am at the inspector and I see the entry 'Custom Colors'. I hover over 'font color' and it says: Property: custom_colors/font_color. So in code I I type "$Label." and expect 'custom_colors' to popup, but it doesn't. So I go to the help and I can see 'Theme Properties' and there is a 'font_color'. But in my head two questions:
Also, Hope this helps :) |
I think the problem is more about making theme properties/overrides be less hacked and more obvious what they are, than adding "proper" setters/getters. Or maybe we could improve the tooltip or documentation (like, by mentioning the Although if setters/getters are enough, they could be better depending on what is easier to implement. |
Properties are always there. Theme properties, however, have a "not enabled" state. This can be seen as the checkbox in the editor. When a theme property is turned off, the control then fallback to the theme. |
Thanks for clarification. I'm just coming from a usability perspective, not
a technical one. At the minute it's difficult to know how to use these
'properties' and doing so via string constants is never a good thing in my
eyes.
I guess it's also compounded by calling some of them 'custom' and they seem
to be separate to 'theme'.
…On Sat, 19 Dec 2020, 23:07 Marc, ***@***.***> wrote:
I'm guessing there is a reason for this lack of accessor methods?
Properties are always there. Theme properties, however, have a "not
enabled" state. This can be seen as the checkbox in the editor. When a
theme property is turned off, yhe control then fallback to the theme.
If we make these "regular" properties, we loose this feature, unless
nullable types are implemented I guess. Otherwise they would have to be all
Variant. Besides we'll be forced to consider null as "not overriden", and
not "overriden with null".
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2000 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCERRK3LXJYMBNV3YPFWULSVUW37ANCNFSM4VAN7SUQ>
.
|
For the record, they've been renamed to restore the association with the theme, the part of which they actually are. The section is now called "Theme Overrides" in both And that's the problem, those theme items are not a part of |
Describe the project you are working on
Platform game
Describe the problem or limitation you are having in your project
I had to search on the internet just to simply figure out how to change a font's colour and other settings because the popup help nor documentation made it easy to figure out (that there was no getter/setter and in the Label in my case, there is literally nothing in the documentation for any of the 'custom' values), but that's not the point really.
Having to call a set (or get) method with a string is not really an ideal method, it's a bit like taking every single getter/setter from every node and saying, sorry please use hard coded strings and triple check you didn't use the wrong slash or use the American and not British spelling :)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Make Control node custom entries first class citizens somehow please, at least for the most commonly used controls and properties...
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
Only if you know how and remember not to make any spelling mistakes
Is there a reason why this should be core and not an add-on in the asset library?
Setting things like label colours, etc should be simple and intuitive
The text was updated successfully, but these errors were encountered: