Skip to content

Sliders and scroll bars should scale to stepSize #31

Closed
@imagejan

Description

@imagejan

When using non-integer numeric inputs with style="slider" or style="scroll bar", the UI widgets only support integer steps (because the underlying JSlider and JScrollbar objects only support int values).

This can be improved by scaling the slider range to the [min; max] range as follows:

  • slider.setMinimum(0)
  • slider.setMaximum( (max-min) / stepSize )
  • slider.setValue( (value-min) / stepSize )
  • value = slider.getValue() * stepSize + min

and setting the slider/scrollbar labels to string representations of the scaled values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions