Add nonKineticScrollingSpeed multiplicator setting

This commit is contained in:
miruka 2020-09-23 23:22:28 -04:00
parent 1df7cb8014
commit c861c29b73
2 changed files with 8 additions and 4 deletions

View File

@ -286,6 +286,7 @@ class UISettings(JSONDataFile):
"lexicalRoomSorting": False, "lexicalRoomSorting": False,
"markRoomReadMsecDelay": 200, "markRoomReadMsecDelay": 200,
"maxMessageCharactersPerLine": 65, "maxMessageCharactersPerLine": 65,
"nonKineticScrollingSpeed": 1.0,
"ownMessagesOnLeftAboveWidth": 895, "ownMessagesOnLeftAboveWidth": 895,
"theme": "Midnight.qpl", "theme": "Midnight.qpl",
"writeAliases": {}, "writeAliases": {},

View File

@ -13,11 +13,14 @@ MouseArea {
// Otherwise use wheel.angleDelta, which is available from mouses and // Otherwise use wheel.angleDelta, which is available from mouses and
// low resolution trackpads. // low resolution trackpads.
// When higher pixelDelta, more scroll will be applied // When higher pixelDelta, more scroll will be applied
const speedMultiply =
Qt.styleHints.wheelScrollLines *
window.settings.nonKineticScrollingSpeed
const pixelDelta = { const pixelDelta = {
x: wheel.pixelDelta.x || x: wheel.pixelDelta.x || wheel.angleDelta.x / 8 * speedMultiply,
wheel.angleDelta.x / 8 * Qt.styleHints.wheelScrollLines, y: wheel.pixelDelta.y || wheel.angleDelta.y / 8 * speedMultiply,
y: wheel.pixelDelta.y ||
wheel.angleDelta.y / 8 * Qt.styleHints.wheelScrollLines,
} }
// Return current position if there was not any movement // Return current position if there was not any movement