D29534: Implement wheel/touchpad scrolling for SpinBox control

2020-05-08 Thread Nathaniel Graham
ngraham added a task: T9460: Consider a more user-friendly SpinBox control.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D29534

To: ngraham, #vdg, #plasma
Cc: cblack, kde-frameworks-devel, LeGast00n, michaelh, ngraham, bruns


D29534: Implement wheel/touchpad scrolling for SpinBox control

2020-05-08 Thread Nathaniel Graham
ngraham edited the summary of this revision.
ngraham edited the test plan for this revision.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D29534

To: ngraham, #vdg, #plasma
Cc: cblack, kde-frameworks-devel, LeGast00n, michaelh, ngraham, bruns


D29534: Implement wheel/touchpad scrolling for SpinBox control

2020-05-08 Thread Nathaniel Graham
ngraham updated this revision to Diff 82311.
ngraham added a comment.


  Implement click-and-drag (along both the X and Y axes) to modify the value

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D29534?vs=82276=82311

BRANCH
  implement-spinbox-wheel-adjustment (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D29534

AFFECTED FILES
  src/declarativeimports/plasmacomponents3/SpinBox.qml

To: ngraham, #vdg, #plasma
Cc: cblack, kde-frameworks-devel, LeGast00n, michaelh, ngraham, bruns


D29534: Implement wheel/touchpad scrolling for SpinBox control

2020-05-08 Thread Nathaniel Graham
ngraham edited the test plan for this revision.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D29534

To: ngraham, #vdg, #plasma
Cc: cblack, kde-frameworks-devel, LeGast00n, michaelh, ngraham, bruns


D29534: Implement wheel/touchpad scrolling for SpinBox control

2020-05-08 Thread Nathaniel Graham
ngraham updated this revision to Diff 82276.
ngraham marked 4 inline comments as done.
ngraham added a comment.


  More control, less parseInt

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D29534?vs=82274=82276

BRANCH
  implement-spinbox-wheel-adjustment (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D29534

AFFECTED FILES
  src/declarativeimports/plasmacomponents3/SpinBox.qml

To: ngraham, #vdg, #plasma
Cc: cblack, kde-frameworks-devel, LeGast00n, michaelh, ngraham, bruns


D29534: Implement wheel/touchpad scrolling for SpinBox control

2020-05-08 Thread Nathaniel Graham
ngraham edited the test plan for this revision.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D29534

To: ngraham, #vdg, #plasma
Cc: cblack, kde-frameworks-devel, LeGast00n, michaelh, ngraham, bruns


D29534: Implement wheel/touchpad scrolling for SpinBox control

2020-05-08 Thread Carson Black
cblack added inline comments.

INLINE COMMENTS

> SpinBox.qml:49
> +if (wheel.angleDelta.y > 0 && control.value <= control.to) {
> +control.value = parseInt(control.value, 10) + 
> control.stepSize
> +valueModified()

`control.value` is already a numeric type as `control` is  a SpinBox, so you 
don't need to `parseInt` here. `control.value =+ control.stepSize`

> SpinBox.qml:50
> +control.value = parseInt(control.value, 10) + 
> control.stepSize
> +valueModified()
> +} else if (wheel.angleDelta.y < 0 && control.value >= 
> control.from) {

I think you would need to explicitly call this on `control`? 
`control.valueModified()`.

> SpinBox.qml:52
> +} else if (wheel.angleDelta.y < 0 && control.value >= 
> control.from) {
> +control.value = parseInt(control.value, 10) - 
> control.stepSize
> +valueModified()

`control.value =- control.stepSize`

> SpinBox.qml:53
> +control.value = parseInt(control.value, 10) - 
> control.stepSize
> +valueModified()
> +}

`control.valueModified()`.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D29534

To: ngraham, #vdg, #plasma
Cc: cblack, kde-frameworks-devel, LeGast00n, michaelh, ngraham, bruns


D29534: Implement wheel/touchpad scrolling for SpinBox control

2020-05-08 Thread Nathaniel Graham
ngraham updated this revision to Diff 82274.
ngraham added a comment.


  Mark the value has having been modified after adjusting by scrolling

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D29534?vs=82273=82274

BRANCH
  implement-spinbox-wheel-adjustment (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D29534

AFFECTED FILES
  src/declarativeimports/plasmacomponents3/SpinBox.qml

To: ngraham, #vdg, #plasma
Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns


D29534: Implement wheel/touchpad scrolling for SpinBox control

2020-05-08 Thread Nathaniel Graham
ngraham created this revision.
ngraham added reviewers: VDG, Plasma.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
ngraham requested review of this revision.

REVISION SUMMARY
  Currently adjusting the value by scrolling is not implemented. This patch 
implements it.

TEST PLAN
  [Coming soon]

REPOSITORY
  R242 Plasma Framework (Library)

BRANCH
  implement-spinbox-wheel-adjustment (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D29534

AFFECTED FILES
  src/declarativeimports/plasmacomponents3/SpinBox.qml

To: ngraham, #vdg, #plasma
Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns