diff --git a/containments/homescreens/folio/package/contents/ui/main.qml b/containments/homescreens/folio/package/contents/ui/main.qml index 1ac314fedecb3e6223a585307526df91226b9b6c..97911635be7718f2f99ac7dbe4f9f7d577d1469f 100644 --- a/containments/homescreens/folio/package/contents/ui/main.qml +++ b/containments/homescreens/folio/package/contents/ui/main.qml @@ -40,20 +40,23 @@ MobileShell.HomeScreen { forceActiveFocus(); } - Plasmoid.onActivated: { - console.log("Triggered!", plasmoid.nativeInterface.showingDesktop) + Plasmoid.onActivated: { + // Always close action drawer + if (MobileShell.TopPanelControls.actionDrawerVisible) { + MobileShell.TopPanelControls.closeActionDrawer(); + } // there's a couple of steps: - // - minimize windows + // - minimize windows (only if we are in an app) // - open app drawer - // - restore windows - if (!plasmoid.nativeInterface.showingDesktop) { + // - close app drawer and, if necessary, restore windows + if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible) { plasmoid.nativeInterface.showingDesktop = true; - } else if (homescreen.homeScreenState.currentView === MobileShell.HomeScreenState.PageView) { - homescreen.homeScreenState.openAppDrawer() + } else if (homescreen.homeScreenState.currentView === HomeScreenState.PageView) { + homescreen.homeScreenState.openAppDrawer(); } else { - plasmoid.nativeInterface.showingDesktop = false - homescreen.homeScreenState.closeAppDrawer() + plasmoid.nativeInterface.showingDesktop = false; + homescreen.homeScreenState.closeAppDrawer(); } }