Bug 505766 - System Settings: Textbox intended for numbers allows characters and no max length
Summary: System Settings: Textbox intended for numbers allows characters and no max le...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_kscreen (other bugs)
Version First Reported In: 6.4.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-19 08:07 UTC by madness742
Modified: 2025-06-23 16:26 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.4.1
Sentry Crash Report:


Attachments
Showcase of the bug. (1.08 MB, video/webm)
2025-06-19 08:07 UTC, madness742
Details

Note You need to log in before you can comment on or make changes to this bug.
Description madness742 2025-06-19 08:07:58 UTC
Created attachment 182379 [details]
Showcase of the bug.

SUMMARY
Under System Settings -> Display Configuration, both "Scale" and "Brightness" allow me to enter characters, without a max length limit. 

STEPS TO REPRODUCE
1. Open System Settings -> Display Configuration.
2. Type in either "Scale" or "Brightness" characters until it's off screen.

OBSERVED RESULT
I can type characters, and there's no limit preventing it from going off screen.

EXPECTED RESULT
The box should not allow for characters, and there should be a limit.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 42
KDE Plasma Version: 6.4.0
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1

ADDITIONAL INFORMATION
- I wrote about this bug under Bug 505763, but I think it's more fitting to open its own bug report.
Comment 1 Nate Graham 2025-06-19 19:57:48 UTC
Hah! I'll fix it.
Comment 2 Nate Graham 2025-06-19 21:57:02 UTC
Unfortunately we can't limit the entry of letters due to the QtQuickControls SpinBox item being fairly limited in what you can do with it. But we can set a size limit for it.
Comment 3 Bug Janitor Service 2025-06-19 21:58:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kscreen/-/merge_requests/403
Comment 4 madness742 2025-06-19 22:24:38 UTC
(In reply to Nate Graham from comment #2)
> Unfortunately we can't limit the entry of letters due to the QtQuickControls
> SpinBox item being fairly limited in what you can do with it. But we can set
> a size limit for it.

Is there any reason why some of the other settings don't have this problem? And there seem to be quite a few other settings where there is no size limit.

Mouse -> Pointer speed (No letters allowed, no max length).
Touchpad -> Pointer speed (No letters allowed, no max length).

Screen Edges -> Trigger quarter tilting in (No letters allowed, can't type more than 2 numbers).
Screen Edges -> Activation Delay (No letters allowed, can't type more than 2 numbers).
Screen Edges -> Reactivation Delay (No letters allowed, can't type more than 2 numbers).

Keyboard -> Keyboard -> Key Repeat (Can type letters, no max length).
Keyboard -> Keyboard -> Rate (Can type letters, no max length if combined with letters).

Multimedia -> Audio CDs -> MP3 Encoder -> Filter Settings [all] (No letters allowed, max length has the correct value for every Hz).
Multimedia -> Audio CDs -> Opus Encoder -> Opus Complexity Setting (No letters allowed, can't type more than 2 numbers).
Multimedia -> Audio CDs -> Flac Encoder -> Flac Compression Level (No letters allowed, can't type more than 2 numbers).

Accessibility -> System Bell -> Visual Bell Duration (Can type letters, no max length).
Accessibility -> Keyboard Filters -> Bounce/Slow keys Delay (Can type letters, no max length).

Accessibility -> Mouse Navigation -> Acceleration Delay/Repeat Interval/Acceleration Time (Can type letters, no max length for letters only). !!these two don't get reset to default value in the UI, need to restart System Settings!!

Accessibility -> Activation Shortcuts -> Disable sticky and slow keys after (Can type letters, no max length for letters only).
Accessibility -> Mouse Navigation -> Maximum speed/Pointer acceleration (No letters allowed, no max length for letters only).

Notifications -> Hide After (Can type letters, no max length).

Window Management -> Window Behaviour -> Focus -> Delay focus by (No letters allowed, can't type more than 4 numbers).
Window Management -> Window Behaviour -> Focus -> Raise on hover, delayed by (No letters allowed, can't type more than 4 numbers).
Window Management -> Window Behaviour -> Movement -> Screen edge/window/center snap zone (No letters allowed, can't type more than 2 numbers).

General Behaviour -> Double-click interval (Can type letters, no max length).
Comment 5 Nate Graham 2025-06-23 16:14:05 UTC
Git commit 0a37f15fb2817480d2dbe11ea420e39a3f94ecd2 by Nate Graham.
Committed on 23/06/2025 at 16:07.
Pushed by ngraham into branch 'master'.

KCM: limit spinbox length

Otherwise they keep expanding as you keep typing, which is fairly silly.
FIXED-IN: 6.4.1

M  +14   -1    kcm/ui/OutputPanel.qml
M  +4    -1    kcm/ui/Panel.qml

https://invent.kde.org/plasma/kscreen/-/commit/0a37f15fb2817480d2dbe11ea420e39a3f94ecd2
Comment 6 Nate Graham 2025-06-23 16:14:19 UTC
Git commit 12d9cc4974ad903f7bc2c26a1514ea9b9a86b358 by Nate Graham.
Committed on 23/06/2025 at 16:14.
Pushed by ngraham into branch 'Plasma/6.4'.

KCM: limit spinbox length

Otherwise they keep expanding as you keep typing, which is fairly silly.
FIXED-IN: 6.4.1


(cherry picked from commit 0a37f15fb2817480d2dbe11ea420e39a3f94ecd2)

Co-authored-by: Nate Graham <nate@kde.org>

M  +14   -1    kcm/ui/OutputPanel.qml
M  +4    -1    kcm/ui/Panel.qml

https://invent.kde.org/plasma/kscreen/-/commit/12d9cc4974ad903f7bc2c26a1514ea9b9a86b358
Comment 7 Nate Graham 2025-06-23 16:26:41 UTC
Thanks for that long list. This is a general problem, unfortunately, that would be ideally solved with a better library component.

The problem right now is that QQC2.SpinBox is fairly limited, and in particular it has no facilities for putting a suffix at the end of the number in a way that's clean. Doing this requires a lot of boilerplate code that needs to be duplicated for every one, and this means number handling is slightly different. It's kind of a mess right now.