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 {}
onActiveFocusChanged: {
if (!activeFocus)
if (!activeFocus) {
_folderView.cancelRename()
dirModel.clearSelection()
}
}
Component.onCompleted: {
dirModel.requestRename.connect(rename)

View file

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

View file

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