mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Improved wheel mouse scrolling in FlowView.qml
This commit is contained in:
parent
6332b4f6e1
commit
874bc595e3
@ -52,9 +52,13 @@ Rectangle {
|
||||
MouseArea {
|
||||
anchors.fill : list
|
||||
onWheel: {
|
||||
|
||||
if(list.moving)
|
||||
return;
|
||||
|
||||
var ci
|
||||
if(wheel.angleDelta.y < 0) {
|
||||
ci = Math.min(list.currentIndex+1, list.count);
|
||||
ci = Math.min(list.currentIndex+1, list.count - 1);
|
||||
}
|
||||
else if(wheel.angleDelta.y > 0) {
|
||||
ci = Math.max(0,list.currentIndex-1);
|
||||
@ -86,6 +90,8 @@ Rectangle {
|
||||
highlightRangeMode: ListView.StrictlyEnforceRange
|
||||
preferredHighlightEnd: 50
|
||||
|
||||
highlightMoveDuration: 250
|
||||
|
||||
delegate: Component {
|
||||
|
||||
//cover
|
||||
@ -168,11 +174,12 @@ Rectangle {
|
||||
|
||||
focus: true
|
||||
Keys.onPressed: {
|
||||
|
||||
if (event.modifiers & Qt.ControlModifier || event.modifiers & Qt.ShiftModifier)
|
||||
return;
|
||||
var ci
|
||||
if (event.key === Qt.Key_Right) {
|
||||
ci = Math.min(list.currentIndex+1, list.count);
|
||||
ci = Math.min(list.currentIndex+1, list.count - 1);
|
||||
}
|
||||
else if (event.key === Qt.Key_Left) {
|
||||
ci = Math.max(0,list.currentIndex-1);
|
||||
|
Loading…
Reference in New Issue
Block a user