homescreens: only close search widget and action drawer without opening the menu

This commit is contained in:
Yari Polla 2022-09-27 17:25:43 +02:00 committed by Devin Lin
parent 838826b4fd
commit f03cf4aa68
2 changed files with 30 additions and 24 deletions

View file

@ -41,6 +41,14 @@ MobileShell.HomeScreen {
} }
Plasmoid.onActivated: { Plasmoid.onActivated: {
// there's a couple of steps:
// - minimize windows (only if we are in an app)
// - open app drawer
// - close app drawer and, if necessary, restore windows
if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible
|| MobileShell.TopPanelControls.actionDrawerVisible
|| searchWidget.isOpen
) {
// Always close action drawer // Always close action drawer
if (MobileShell.TopPanelControls.actionDrawerVisible) { if (MobileShell.TopPanelControls.actionDrawerVisible) {
MobileShell.TopPanelControls.closeActionDrawer(); MobileShell.TopPanelControls.closeActionDrawer();
@ -51,11 +59,6 @@ MobileShell.HomeScreen {
searchWidget.close(); searchWidget.close();
} }
// there's a couple of steps:
// - minimize windows (only if we are in an app)
// - open app drawer
// - close app drawer and, if necessary, restore windows
if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible) {
plasmoid.nativeInterface.showingDesktop = true; plasmoid.nativeInterface.showingDesktop = true;
} else if (homescreen.homeScreenState.currentView === HomeScreenState.PageView) { } else if (homescreen.homeScreenState.currentView === HomeScreenState.PageView) {
homescreen.homeScreenState.openAppDrawer(); homescreen.homeScreenState.openAppDrawer();

View file

@ -40,6 +40,14 @@ MobileShell.HomeScreen {
} }
Plasmoid.onActivated: { Plasmoid.onActivated: {
// there's a couple of steps:
// - minimize windows (only if we are in an app)
// - open app drawer
// - close app drawer and, if necessary, restore windows
if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible
|| MobileShell.TopPanelControls.actionDrawerVisible
|| search.isOpen
) {
// Always close action drawer // Always close action drawer
if (MobileShell.TopPanelControls.actionDrawerVisible) { if (MobileShell.TopPanelControls.actionDrawerVisible) {
MobileShell.TopPanelControls.closeActionDrawer(); MobileShell.TopPanelControls.closeActionDrawer();
@ -50,11 +58,6 @@ MobileShell.HomeScreen {
search.close(); search.close();
} }
// there's a couple of steps:
// - minimize windows (only if we are in an app)
// - open app drawer
// - close app drawer and, if necessary, restore windows
if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible) {
plasmoid.nativeInterface.showingDesktop = true; plasmoid.nativeInterface.showingDesktop = true;
} else if (homescreen.page == 0) { } else if (homescreen.page == 0) {
homescreen.page = 1; homescreen.page = 1;