fix(qml):补充应用组点击空白区域完成重命名的功能
This commit is contained in:
parent
67d9b21beb
commit
47463f9e67
|
@ -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: {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue