aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop/Page.qml31
-rw-r--r--desktop/Settings.qml6
2 files changed, 37 insertions, 0 deletions
diff --git a/desktop/Page.qml b/desktop/Page.qml
index eb1c5c0..02b2da8 100644
--- a/desktop/Page.qml
+++ b/desktop/Page.qml
@@ -138,6 +138,27 @@ Item {
anchors.topMargin: 12
clip: true
contentWidth: availableWidth
+ // Faster wheel scrolling than Qt's defaults (2500, 1500); the
+ // sidebar and the landing page in Settings.qml use the same pair.
+ Component.onCompleted: {
+ scroll.contentItem.maximumFlickVelocity = 8000;
+ scroll.contentItem.flickDeceleration = 4000;
+ }
+
+ // Page Up/Down, Home/End scroll the page. Reached when the page
+ // itself has focus (a click on empty space, below) or bubbling up
+ // from a field, which keeps Home/End for its cursor.
+ Keys.onPressed: e => {
+ const f = scroll.contentItem, max = Math.max(0, f.contentHeight - f.height);
+ const to = e.key === Qt.Key_PageUp ? f.contentY - f.height * 0.9
+ : e.key === Qt.Key_PageDown ? f.contentY + f.height * 0.9
+ : e.key === Qt.Key_Home ? 0
+ : e.key === Qt.Key_End ? max : null;
+ if (to === null) return;
+ f.cancelFlick();
+ f.contentY = Math.max(0, Math.min(to, max));
+ e.accepted = true;
+ }
Item {
id: holder
@@ -146,6 +167,16 @@ Item {
}
}
+ // A click on empty page space focuses the page, for the keys above.
+ // Beneath the content, so fields and buttons keep their clicks; it takes
+ // no wheel (no onWheel) and the Flickable still steals drags from it.
+ MouseArea {
+ parent: holder
+ z: -1
+ anchors.fill: parent
+ onPressed: scroll.forceActiveFocus()
+ }
+
// The reveal highlight, over the row and in holder's coordinates.
// Declared out here, not in the ScrollView, which sizes from a single
// child; parent puts it in holder all the same.
diff --git a/desktop/Settings.qml b/desktop/Settings.qml
index 6b81586..2e151a9 100644
--- a/desktop/Settings.qml
+++ b/desktop/Settings.qml
@@ -228,6 +228,9 @@ Scope {
// Without it a scrolled list draws over the search box.
clip: true
model: root.found
+ // Faster wheel scrolling, as Page.qml.
+ maximumFlickVelocity: 8000
+ flickDeceleration: 4000
// A group's heading above its first entry, then the entry.
delegate: Column {
@@ -449,6 +452,9 @@ Scope {
contentHeight: about.height
clip: true
boundsBehavior: Flickable.StopAtBounds
+ // Faster wheel scrolling, as Page.qml.
+ maximumFlickVelocity: 8000
+ flickDeceleration: 4000
ScrollBar.vertical: ScrollBar {}
Column {