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 minimum_character_count to SpinBox #64538
base: master
Are you sure you want to change the base?
Conversation
It seems a bit weird to me to add a property that is used to set theme overrides on an internal node. Can't we have theme items in SpinBox that could do that in a cleaner way? CC @YuriSizov |
My first question is, why wouldn't it be a feature of LineEdit, to automatically adjust the width? Why would we only put it in the higher-order control? If it's a feature of LineEdit, then SpinBox can have a proxy property to enable it without touching the theme, and SpinBox can have its own theme property exposed that would directly override the LineEdit's property. In more general terms, I think we need utilize type variations for every customizable control which is an inner child of another built-in control. So themes can be created globally and granularly. |
The auto-adjustment I added adjusts the LineEdit to the maximum possible width achievable with the specified value range (.e.g for |
Hmm, I see. This is a weird case for theme properties, to have I think it's worth adding a theme property to SpinBox as well, though, and then using the biggest minimum we have out of two to override the LineEdit's theme property. That way we preserve direct control for styling, if it is needed in a project. And then I guess this doesn't need to be an integer field |
Rebased.
I don't think this can be implemented without modifying LineEdit. Affecting the LineEdit's character count in any way requires adding override for the property, but then it's impossible to use "biggest minimum we have out of two", because adding override will shift the value in LineEdit. |
Closes godotengine/godot-proposals#4138
Defaults to auto-adjust, but it doesn't seem to work well. I'm using the
minimum_character_width
theme property of LineEdit and it tends to make the SpinBox wider than necessary. Also determining the longest possible string is a bit tricky. But other than that, the feature is functional.