Desktop: When the focus is lost, the rename will also be cancelled

This commit is contained in:
cutefishd 2021-05-05 22:27:33 +08:00
parent ab343fb176
commit 4f57fa63b8
3 changed files with 12 additions and 1 deletions

View file

@ -105,9 +105,11 @@ Item {
delegate: FolderGridItem {} delegate: FolderGridItem {}
onActiveFocusChanged: { onActiveFocusChanged: {
if (!activeFocus) if (!activeFocus) {
_folderView.cancelRename()
dirModel.clearSelection() dirModel.clearSelection()
} }
}
Component.onCompleted: { Component.onCompleted: {
dirModel.requestRename.connect(rename) dirModel.requestRename.connect(rename)

View file

@ -214,6 +214,10 @@ GridView {
currentIndex: -1 currentIndex: -1
ScrollBar.vertical: ScrollBar { } ScrollBar.vertical: ScrollBar { }
FishUI.WheelHandler {
target: control
}
onPressXChanged: { onPressXChanged: {
cPress = mapToItem(control.contentItem, pressX, pressY) cPress = mapToItem(control.contentItem, pressX, pressY)
} }

View file

@ -37,6 +37,11 @@ ListView {
clip: true clip: true
ScrollBar.vertical: ScrollBar { } ScrollBar.vertical: ScrollBar { }
boundsBehavior: Flickable.StopAtBounds
FishUI.WheelHandler {
target: control
}
function rename() { function rename() {
if (currentIndex !== -1) { if (currentIndex !== -1) {