Page MenuHomePhabricator

efl_ui/spin_button: fix step clamping

Authored by zmike on Jan 2 2020, 11:06 AM.



values for this needs to be rounded off the step in order to be expected
step-values and not just double garbage

Diff Detail

rEFL core/efl
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
zmike created this revision.Jan 2 2020, 11:06 AM
zmike requested review of this revision.Jan 2 2020, 11:06 AM
bu5hm4n added a comment.EditedJan 3 2020, 8:15 AM

The question here is, if you have a spin button with limits 10 and 30, the value that you get is 20, step is 2.7, now you press ">" the value will then be 21.6, the next click brings you to 24.3, is that acceptable ?

You mean that the problem is that 20 is not an exact step multiple?

No, the problem is:

  • you can never hit 20 again
  • the first increment made is smaller than step.

Yeah, so 20 is not a valid value for this widget. We should make sure the user can never retrieve an invalid value.
I would even round any value the user tries to set directly.

Unknown Object (User) added a subscriber: Unknown Object (User).Jan 4 2020, 4:27 PM
This comment was removed by raster.
raster added a subscriber: raster.Jan 4 2020, 5:20 PM

Okay, but that is a change to the step property, we should ensure that Efl.Ui.Slider is doing the same.

This is how I always expected step to work.
Would it be a lot of work to make the sliders behave like this?

bu5hm4n accepted this revision.Jan 8 2020, 12:58 PM

slider seems to work like this.

This revision is now accepted and ready to land.Jan 8 2020, 12:58 PM
Closed by commit rEFLb6ea86497000: efl_ui/spin_button: fix step clamping (authored by zmike, committed by Marcel Hollerbach <>). · Explain WhyJan 13 2020, 6:58 AM
This revision was automatically updated to reflect the committed changes.