fix(qml): 修复搜索后切换全屏/默认大小,搜索框内容丢失

This commit is contained in:
youdiansaodongxi 2024-07-08 15:46:39 +08:00
parent 45005ad266
commit 8d5436408e
4 changed files with 11 additions and 0 deletions

View File

@ -30,6 +30,10 @@ Item {
inputStatus = true;
}
}
Component.onCompleted: {
text = root.currentSearchText;
}
}
function changeToSearch(keyEvent) {

View File

@ -142,6 +142,10 @@ FocusScope {
AppPageBackend.startSearch(text);
}
}
Component.onCompleted: {
text = root.currentSearchText;
}
}
}

View File

@ -53,8 +53,10 @@ Item {
onClicked: {
if (mainWindow.isFullScreen) {
root.currentSearchText = searchInputBar.text;
mainWindow.exitFullScreen();
} else {
root.currentSearchText = appPage.search.searchInputBar.text;
mainWindow.isFullScreen = true;
}
}

View File

@ -28,6 +28,7 @@ Item {
clip: true
property int animationDuration: menuSetting.get("animationDuration")
property var normalGeometry: mainWindow.normalRect
property string currentSearchText: ""
Component.onCompleted: {
mainWindow.fullScreenChanged.connect(enterFullScreen);