Skip to content
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

Adding min-text-box-width to SpinBox widget #6062

Open
Enyium opened this issue Sep 9, 2024 · 1 comment
Open

Adding min-text-box-width to SpinBox widget #6062

Enyium opened this issue Sep 9, 2024 · 1 comment
Labels
a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request

Comments

@Enyium
Copy link
Contributor

Enyium commented Sep 9, 2024

If the SpinBox widget would get a new property that could, e.g., be called min-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's ch 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 box LineEdit could allow to specify its text viewport width (space actually available to present text, instead of just the outer bounds), like with viewport-width, min-viewport-width and max-viewport-width.

@ogoffart ogoffart added a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) need triaging Issue that the owner of the area still need to triage labels Sep 9, 2024
@FloVanGH
Copy link
Member

Hi, thank you very much for your report. I think it make sense to find a solution here. And thank you for the suggestion how the problem could be solved.

@FloVanGH FloVanGH added enhancement New feature or request and removed need triaging Issue that the owner of the area still need to triage labels Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:widgets Implementation of widgets (from std-widgets.slint) and their styles (mF,bS) enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants