-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Make EditorSpinSlider display a slider for floats with a step of 1.0 #95169
Make EditorSpinSlider display a slider for floats with a step of 1.0 #95169
Conversation
be04816
to
860756c
Compare
fb6c1d0
to
456bc37
Compare
Actually I read a bit too fast, I see now that this is changing the current behavior where exported ints with a step != 1 actually show a slider. This does warrant some more discussion IMO to make sure this is the UX users will expect. |
To be honest, until I saw this PR, I thought spinners were for integers and sliders were for floats in the inspector 🤣 |
I feel this new I wonder if we shouldn't instead deprecate Then And the Better naming suggestions welcome, we don't really use "widget" in Godot speak currently. This would also add the possibility to use a slider with integers if desired, by making a custom EditorProperty for ints that sets |
You mean in EditorSpinSlider? It would be inconvenient to use without a dedicated hint. |
I suggest we could add dedicated hints for it, but realistically, this is mostly an implementation detail and in the vast majority of cases users wouldn't need to think about it or specify it manually. int properties would use the SpinBox and float properties would use the slider automatically. We can drop exposing the functionality to users for now and just keep it internally (thus no hint strings needed). My main concern with this PR is how it exposes an editor implementation detail as a public property. |
Integers still don't display a slider (and use up/down arrows instead), so that they can be quickly distinguished from floats in the inspector. However, this now makes floats with a step of 1.0 look different from integers in the inspector.
456bc37
to
57700b0
Compare
Thanks! |
Integers still don't display a slider (and use up/down arrows instead), so that they can be quickly distinguished from floats in the inspector. The original issue mentioned that integers could be made to look like floats in the inspector, but it means we'd be losing this particular UX affordance, so I didn't go as far as making all integers have a slider for now.
However, this now makes floats with a step of 1.0 look different from integers in the inspector. This complements #47502 in that sense.
Preview
Before
After