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