Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions qml/FullscreenFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ InputEventItem {
} else {
gridViewContainer.setPreviousPageSwitch(false)
}
listviewPage.previousIndex = listviewPage.currentIndex
// 延迟更新previousIndex,避免重复处理
Qt.callLater(function() {
listviewPage.previousIndex = listviewPage.currentIndex
})
}

Keys.onLeftPressed: function(event) {
Expand All @@ -394,7 +397,7 @@ InputEventItem {
}
Keys.onRightPressed: function(event) {
if (listItem.viewIndex === (itemPageModel.rowCount() - 1) && itemPageModel.rowCount() > 1) {
// is the last page, go to last page
// is the last page, go to first page
listviewPage.setCurrentIndex(0)
} else {
// not the last page, simply use SwipeView default behavior
Expand Down
12 changes: 1 addition & 11 deletions qml/GridViewContainer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ FocusScope {
Rectangle {
anchors {
fill: parent
margins: 5
margins: 5
}
radius: 18
color: Qt.rgba(0, 0, 0, 0.2)
Expand All @@ -135,16 +135,6 @@ FocusScope {
// not wroking
move: root.itemMove
moveDisplaced: root.itemMove

Keys.onPressed: function (event) {
if (event.key === Qt.Key_Right && currentIndex === gridView.count - 1) {
gridView.currentIndex = 0;
event.accepted = true;
} else if (event.key === Qt.Key_Left && currentIndex === 0) {
currentIndex = gridView.count - 1;
event.accepted = true;
}
}
}
}

Expand Down