diff --git a/qml/AppUI/EditText.qml b/qml/AppUI/EditText.qml index 4db642e..ad9e7d6 100644 --- a/qml/AppUI/EditText.qml +++ b/qml/AppUI/EditText.qml @@ -28,6 +28,7 @@ Item { property bool textCenterIn: false property bool editStatus: false property string textEdited: title + property string text: editLoader.item.text property real textSize signal textEditingFinished(string text) @@ -61,6 +62,7 @@ Item { border.width: 2 borderAlpha: textEdit.activeFocus ? 1 : 0 borderColor: Platform.Theme.Highlight + property string text: textEdit.text TextInput { id: textEdit @@ -112,7 +114,7 @@ Item { anchors.centerIn: parent width: 16; height: width source: "image://theme/edit-clear-symbolic" - mode: isFullScreen ? UkuiItems.Icon.Highlight : UkuiItems.Icon.AutoHighlight + mode: UkuiItems.Icon.AutoHighlight } onClicked: { diff --git a/qml/extensions/FolderGridView.qml b/qml/extensions/FolderGridView.qml index 3ebcfc9..7b2708b 100644 --- a/qml/extensions/FolderGridView.qml +++ b/qml/extensions/FolderGridView.qml @@ -125,7 +125,15 @@ Loader { properties: "contentMargins, labelMagrins, labelSpacing, labelMagrins" } } - ScriptAction { script: content.folderSwipeView.hideFolder() } + ScriptAction { + script: { + // 点击空白区域实现重命名并收起应用组 + if (folderNameText.text !== folderNameText.textEdited) { + folderModel.renameFolder(folderNameText.text); + } + content.folderSwipeView.hideFolder() + } + } } }, Transition { diff --git a/qml/extensions/FullScreenFolder.qml b/qml/extensions/FullScreenFolder.qml index 37a47fc..176a209 100644 --- a/qml/extensions/FullScreenFolder.qml +++ b/qml/extensions/FullScreenFolder.qml @@ -124,7 +124,14 @@ Loader { properties: "contentMargins, labelMagrins, labelSpacing, labelMagrins" } } - ScriptAction { script: content.folderSwipeView.hideFolder() } + ScriptAction { + script: { + // 点击空白区域实现重命名并收起应用组 + if (folderNameText.text !== folderNameText.textEdited) { + folderModel.renameFolder(folderNameText.text); + } + content.folderSwipeView.hideFolder() + }} } }, Transition {