From 5c52d745220f5f55bca106a7b95ee24986260d6e Mon Sep 17 00:00:00 2001 From: youdiansaodongxi Date: Mon, 8 Jul 2024 15:46:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(qml):=20=E4=BF=AE=E5=A4=8D=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=90=8E=E5=88=87=E6=8D=A2=E5=85=A8=E5=B1=8F/?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=A4=A7=E5=B0=8F=EF=BC=8C=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=A1=86=E5=86=85=E5=AE=B9=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/AppUI/AppPageSearch.qml | 4 ++++ qml/AppUI/FullScreenUI.qml | 4 ++++ qml/AppUI/Sidebar.qml | 2 ++ qml/main.qml | 1 + 4 files changed, 11 insertions(+) diff --git a/qml/AppUI/AppPageSearch.qml b/qml/AppUI/AppPageSearch.qml index 6572995..8b3118b 100644 --- a/qml/AppUI/AppPageSearch.qml +++ b/qml/AppUI/AppPageSearch.qml @@ -30,6 +30,10 @@ Item { inputStatus = true; } } + + Component.onCompleted: { + text = root.currentSearchText; + } } function changeToSearch(keyEvent) { diff --git a/qml/AppUI/FullScreenUI.qml b/qml/AppUI/FullScreenUI.qml index 21e0156..c1cf4c9 100644 --- a/qml/AppUI/FullScreenUI.qml +++ b/qml/AppUI/FullScreenUI.qml @@ -142,6 +142,10 @@ FocusScope { AppPageBackend.startSearch(text); } } + + Component.onCompleted: { + text = root.currentSearchText; + } } } diff --git a/qml/AppUI/Sidebar.qml b/qml/AppUI/Sidebar.qml index 18dda64..2a5aacb 100644 --- a/qml/AppUI/Sidebar.qml +++ b/qml/AppUI/Sidebar.qml @@ -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; } } diff --git a/qml/main.qml b/qml/main.qml index 7768584..dfc063e 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -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);