Currently adjusting the value by scroll and click/touch+drag are not implemented.
This patch implements them.
Details
- Reviewers
ahiemstra - Group Reviewers
VDG Plasma - Maniphest Tasks
- T9460: Consider a more user-friendly SpinBox control
- Commits
- R242:1636b566bd0b: Implement scroll and drag adjustment of values for SpinBox control
As far as I can tell, the PlasmaComponents3.Spinbox is not actually used anywhere in Plasma, so test with D29535:
Diff Detail
- Repository
- R242 Plasma Framework (Library)
- Branch
- implement-spinbox-wheel-adjustment (branched from master)
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 26563 Build 26581: arc lint + arc unit
src/declarativeimports/plasmacomponents3/SpinBox.qml | ||
---|---|---|
49 | control.value is already a numeric type as control is a SpinBox, so you don't need to parseInt here. control.value =+ control.stepSize | |
50 | I think you would need to explicitly call this on control? control.valueModified(). | |
52 | control.value =- control.stepSize | |
53 | control.valueModified(). |
I don't like the look of those +/- buttons. I think this makes it harder to know that you can drag the panel height up and down.
That would be a comment for D29535, but I will repeat my argument here: I think that drag is the least important interaction method for panel thickness adjustment since you typically want to make fine adjustments or arrive at a specific value, both of which are unsuited for drag-based interactions. Nevertheless, I have implemented drag-adjustment in the spinbox control here to not lose it, which also yields the advantage that other potential Plasma components that use a spinbox will benefit from it.
We can improve the look of this control in another patch. To my knowledge it hasn't been used at all so it wouldn't surprise me if it's a bit unpolished.
src/declarativeimports/plasmacomponents3/SpinBox.qml | ||
---|---|---|
51 ↗ | (On Diff #82273) | You can do mouse.accepted = false instead of forceActiveFocus to allow the mouse press to go to items below it. However, you might instead want to use DragHandler's onActiveChanged for this, as that signals when the actual drag is active. |