Adding min-text-box-width
to SpinBox
widget
#6062
Labels
a:widgets
Implementation of widgets (from std-widgets.slint) and their styles (mF,bS)
enhancement
New feature or request
If the
SpinBox
widget would get a new property that could, e.g., be calledmin-text-box-width
and would just describe the width of the inner text box, you could avoid its buttons under your mouse cursor being shifted during their use when the number of digits changes, while still keeping the widget as narrow as needed, and allowing for more digits than expected, because it's just a minimum width.A user could then, e.g., define it as:
min-text-box-width: 2rem;
. Although, an equivalent to CSS'sch
unit would be more suitable.EDIT: For number text boxes like
SpinBox
, the property name could refer specifically to the value to logically exclude the unit (as described in #6250) - e.g.,min-value-width
. This would reserve that amount of space just for the value; the prefix and suffix width would internally be added to that. (Of course, this space reservation wouldn't influence rendering: Prefix, value, and suffix would still be rendered as one string, as long as the widget style doesn't have something else in mind.) Then, the general-purpose text boxLineEdit
could allow to specify its text viewport width (space actually available to present text, instead of just the outer bounds), like withviewport-width
,min-viewport-width
andmax-viewport-width
.The text was updated successfully, but these errors were encountered: