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,
"markRoomReadMsecDelay": 200,
"maxMessageCharactersPerLine": 65,
"nonKineticScrollingSpeed": 1.0,
"ownMessagesOnLeftAboveWidth": 895,
"theme": "Midnight.qpl",
"writeAliases": {},

View File

@ -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