Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 5c4dbf15 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Vertical scroll in timeline with Shift + Wheel

parent 81dc0acc
......@@ -67,18 +67,25 @@ Rectangle {
function zoomByWheel(wheel) {
if (wheel.modifiers & Qt.AltModifier) {
// Seek to next snap
if (wheel.angleDelta.x > 0) {
timeline.triggerAction('monitor_seek_snap_backward')
} else {
timeline.triggerAction('monitor_seek_snap_forward')
}
} else if (wheel.modifiers & Qt.ControlModifier) {
// Zoom
if (wheel.angleDelta.y > 0) {
root.zoomIn(true);
} else {
root.zoomOut(true);
}
} else if (wheel.modifiers & Qt.ShiftModifier) {
// Vertical scroll
var newScroll = Math.min(scrollView.flickableItem.contentY - wheel.angleDelta.y, trackHeaders.height - tracksArea.height + scrollView.__horizontalScrollBar.height + cornerstone.height)
scrollView.flickableItem.contentY = Math.max(newScroll, 0)
} else {
// Horizontal scroll
var newScroll = Math.min(scrollView.flickableItem.contentX - wheel.angleDelta.y, timeline.fullDuration * root.timeScale - (scrollView.width - scrollView.__verticalScrollBar.width))
scrollView.flickableItem.contentX = Math.max(newScroll, 0)
}
......
  • This is opposite the conventional behaviour of pretty much every operating system, desktop environment, UI framework, application and platform. I would recommend inverting the vertical and horizontal scrolling that this commit implements. i.e. unmodified scrolling for vertical, Shift + scrolling for horizontal. Users would be far less likely to get a jarring UX that way.

    At the least, this should be an application setting/preference to let the user decide the way they want Shift + scroll to behave.

    Edited by Pistos Pi
  • Suggested patch:

    diff --git a/src/timeline2/view/qml/timeline.qml b/src/timeline2/view/qml/timeline.qml
    index 948b52ca6..8fb331e63 100644
    --- a/src/timeline2/view/qml/timeline.qml
    +++ b/src/timeline2/view/qml/timeline.qml
    @@ -81,13 +81,13 @@ Rectangle {
                     root.zoomOut(true);
                 }
             } else if (wheel.modifiers & Qt.ShiftModifier) {
    -            // Vertical scroll
    -            var newScroll = Math.min(scrollView.flickableItem.contentY - wheel.angleDelta.y, trackHeaders.height - tracksArea.height + scrollView.__horizontalScrollBar.height + cornerstone.height)
    -            scrollView.flickableItem.contentY = Math.max(newScroll, 0)
    -        } else {
                 // Horizontal scroll
                 var newScroll = Math.min(scrollView.flickableItem.contentX - wheel.angleDelta.y, timeline.fullDuration * root.timeScale - (scrollView.width - scrollView.__verticalScrollBar.width))
                 scrollView.flickableItem.contentX = Math.max(newScroll, 0)
    +        } else {
    +            // Vertical scroll
    +            var newScroll = Math.min(scrollView.flickableItem.contentY - wheel.angleDelta.y, trackHeaders.height - tracksArea.height + scrollView.__horizontalScrollBar.height + cornerstone.height)
    +            scrollView.flickableItem.contentY = Math.max(newScroll, 0)
             }
             wheel.accepted = true
         }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment