Page MenuHomePhabricator

Efl.Ui.Slider step property is weird
Open, NormalPublic


The step property is very strange in elm Slider , it is clamped in the range 0.0-1.0
seems it is threated as a percentage and not like a normal values like it should be.

For example is not possible to setup a slider as:

min=0 max=100 step=5

in fact in the elm test there is a nasty function _step_size_calculate() that try to avoid the issue.

Also the step property is not taken in account when you drag the slider with the mouse, it only work with keyboard (as the doc say).

IMO this property should be fixed to behave "normally" and work also when dragging.

DaveMDS created this task.Nov 6 2016, 5:37 AM
zmike edited projects, added Restricted Project; removed efl.Jun 11 2018, 6:54 AM
q66 edited projects, added efl: widgets; removed Restricted Project.Jun 11 2018, 7:33 AM
zmike added subscribers: cedric, bu5hm4n, segfaultxavi, zmike.

Yeah it looks like step is currently expected to be 1 / step_size which seems pretty hostile to developers.

Agreed. The API for Efl.Ui.Slider allows setting any value for min and max but then restricts step to the [0, 1] range, which is weird (in src/lib/elementary/efl_ui_slider.c).
Dragging with the mouse seems to take step into account in the calculations, but it just does not work. efl_ui_drag_step_move() is used but efl_ui_drag_step_set() is never called...

I am changing the ticket name, since we cannot change the legacy API of Elm.Slider, right?

segfaultxavi renamed this task from elm.Slider step property is weird to Efl.Ui.Slider step property is weird.Jan 16 2019, 1:52 AM
zmike added a comment.Jan 16 2019, 5:28 AM

Correct; this could only be changed for the interface api.

segfaultxavi moved this task from Backlog to Evaluating on the efl: api board.Feb 5 2019, 3:34 AM

I think the API is OK, except for the docs in efl_ui_range_display.eo, which state that range_min_max can be anything, but range_value must be in the [0, 1] interval. I see no reason for this arbitrary restriction.

As @DaveMDS posted initially, there are implementation issues regarding the range_step in efl_ui_range_interactive.eo, but the API seems fine.

zmike moved this task from Evaluating to "easy" on the efl: api board.Feb 6 2019, 5:37 AM
zmike moved this task from "easy" to Backlog on the efl: api board.Feb 7 2019, 8:34 AM