From 838826b4fdd47e4ca3d19f7b74233e419d38726e Mon Sep 17 00:00:00 2001 From: Yari Polla Date: Sun, 25 Sep 2022 20:23:57 +0200 Subject: [PATCH] homescreens: also close the search widget with Meta key --- components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml | 1 + containments/homescreens/folio/package/contents/ui/main.qml | 5 +++++ .../homescreens/halcyon/package/contents/ui/main.qml | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml b/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml index 43f925c3..48aea31a 100644 --- a/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml +++ b/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml @@ -58,6 +58,7 @@ Item { readonly property real closedContentY: PlasmaCore.Units.gridUnit * 5 readonly property real openedContentY: 0 readonly property real openFactor: Math.max(0, Math.min(1, 1 - flickable.contentY / closedContentY)) + readonly property bool isOpen: openFactor != 0 Rectangle { anchors.fill: parent diff --git a/containments/homescreens/folio/package/contents/ui/main.qml b/containments/homescreens/folio/package/contents/ui/main.qml index 97911635..ea8b58d4 100644 --- a/containments/homescreens/folio/package/contents/ui/main.qml +++ b/containments/homescreens/folio/package/contents/ui/main.qml @@ -46,6 +46,11 @@ MobileShell.HomeScreen { MobileShell.TopPanelControls.closeActionDrawer(); } + // Always close the search widget as well + if (searchWidget.isOpen) { + searchWidget.close(); + } + // there's a couple of steps: // - minimize windows (only if we are in an app) // - open app drawer diff --git a/containments/homescreens/halcyon/package/contents/ui/main.qml b/containments/homescreens/halcyon/package/contents/ui/main.qml index 1df10e57..c44d8abe 100644 --- a/containments/homescreens/halcyon/package/contents/ui/main.qml +++ b/containments/homescreens/halcyon/package/contents/ui/main.qml @@ -45,6 +45,11 @@ MobileShell.HomeScreen { MobileShell.TopPanelControls.closeActionDrawer(); } + // Always close the search widget as well + if (search.isOpen) { + search.close(); + } + // there's a couple of steps: // - minimize windows (only if we are in an app) // - open app drawer