Skip to content

Commit

Permalink
Add nonKineticScrollingSpeed multiplicator setting
Browse files Browse the repository at this point in the history
  • Loading branch information
mirukana committed Sep 24, 2020
1 parent 4dc5c9a commit 7587e55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/backend/user_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def alt_or_cmd() -> str:
"lexicalRoomSorting": False,
"markRoomReadMsecDelay": 200,
"maxMessageCharactersPerLine": 65,
"nonKineticScrollingSpeed": 1.0,
"ownMessagesOnLeftAboveWidth": 895,
"theme": "Midnight.qpl",
"writeAliases": {},
Expand Down
11 changes: 7 additions & 4 deletions src/gui/Base/HKineticScrollingDisabler.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ MouseArea {
// Otherwise use wheel.angleDelta, which is available from mouses and
// low resolution trackpads.
// When higher pixelDelta, more scroll will be applied

const speedMultiply =
Qt.styleHints.wheelScrollLines *
window.settings.nonKineticScrollingSpeed

const pixelDelta = {
x: wheel.pixelDelta.x ||
wheel.angleDelta.x / 8 * Qt.styleHints.wheelScrollLines,
y: wheel.pixelDelta.y ||
wheel.angleDelta.y / 8 * Qt.styleHints.wheelScrollLines,
x: wheel.pixelDelta.x || wheel.angleDelta.x / 8 * speedMultiply,
y: wheel.pixelDelta.y || wheel.angleDelta.y / 8 * speedMultiply,
}

// Return current position if there was not any movement
Expand Down

3 comments on commit 7587e55

@toger5
Copy link

@toger5 toger5 commented on 7587e55 Sep 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tired the commit. It somehow does not increse the seed instead it starts to glitch when i put the speed to sth bigger 1.0 (like 3.0)
MBP 2015, fedora, wayland (sway)

@mirukana
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the glitch like? Does decreasing the speed below 1.0 works? Maybe @vSLG can test and fix it for trackpads.

@toger5
Copy link

@toger5 toger5 commented on 7587e55 Sep 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast trackpad movements result rusult in weired jumps. It looks very similar to a low frame rate. because when releasing the trackpad scroll body is positioned at the right position. yea a speed of 1.0 does work.

Please sign in to comment.