From 10fb72f8f7d32a7bab20214bef1fd86809264b19 Mon Sep 17 00:00:00 2001 From: Wang Zichong Date: Mon, 13 Nov 2023 11:24:40 +0800 Subject: [PATCH] fix:(FullscreenFrame): reset keyboard focus and search text when hide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当隐藏全屏启动器时,清除键盘焦点,清除搜索状态。 Issue: https://github.com/linuxdeepin/developer-center/issues/6162 Log: --- qml/FullscreenFrame.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qml/FullscreenFrame.qml b/qml/FullscreenFrame.qml index ec559fb7..a65892f0 100644 --- a/qml/FullscreenFrame.qml +++ b/qml/FullscreenFrame.qml @@ -14,9 +14,11 @@ import org.deepin.vendored 1.0 import org.deepin.launchpad 1.0 Control { + id: baseLayer visible: true anchors.fill: parent focus: true + objectName: "FullscreenFrame-BaseLayer" leftPadding: (DesktopIntegration.dockPosition === Qt.LeftArrow ? DesktopIntegration.dockGeometry.width : 0) + 20 rightPadding: (DesktopIntegration.dockPosition === Qt.RightArrow ? DesktopIntegration.dockGeometry.width : 0) + 20 @@ -365,4 +367,16 @@ Control { LauncherController.visible = false; } } + + Connections { + target: LauncherController + function onVisibleChanged() { + // only do these clean-up steps on launcher get hide + if (LauncherController.visible) return + // clear searchEdit text + searchEdit.text = "" + // reset(remove) keyboard focus + baseLayer.focus = true + } + } }