From 4f57fa63b87f5dbdec936323ca7b5ad20b190b6f Mon Sep 17 00:00:00 2001 From: cutefishd Date: Wed, 5 May 2021 22:27:33 +0800 Subject: [PATCH] Desktop: When the focus is lost, the rename will also be cancelled --- qml/Desktop/main.qml | 4 +++- qml/FolderGridView.qml | 4 ++++ qml/FolderListView.qml | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/qml/Desktop/main.qml b/qml/Desktop/main.qml index 3d37fd9..6470e1e 100644 --- a/qml/Desktop/main.qml +++ b/qml/Desktop/main.qml @@ -105,8 +105,10 @@ Item { delegate: FolderGridItem {} onActiveFocusChanged: { - if (!activeFocus) + if (!activeFocus) { + _folderView.cancelRename() dirModel.clearSelection() + } } Component.onCompleted: { diff --git a/qml/FolderGridView.qml b/qml/FolderGridView.qml index fd1b015..091ca27 100644 --- a/qml/FolderGridView.qml +++ b/qml/FolderGridView.qml @@ -214,6 +214,10 @@ GridView { currentIndex: -1 ScrollBar.vertical: ScrollBar { } + FishUI.WheelHandler { + target: control + } + onPressXChanged: { cPress = mapToItem(control.contentItem, pressX, pressY) } diff --git a/qml/FolderListView.qml b/qml/FolderListView.qml index a9b9fe9..7270aef 100644 --- a/qml/FolderListView.qml +++ b/qml/FolderListView.qml @@ -37,6 +37,11 @@ ListView { clip: true ScrollBar.vertical: ScrollBar { } + boundsBehavior: Flickable.StopAtBounds + + FishUI.WheelHandler { + target: control + } function rename() { if (currentIndex !== -1) {