mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
homescreens: only close search widget and action drawer without opening the menu
This commit is contained in:
parent
838826b4fd
commit
f03cf4aa68
2 changed files with 30 additions and 24 deletions
|
|
@ -40,22 +40,25 @@ MobileShell.HomeScreen {
|
||||||
forceActiveFocus();
|
forceActiveFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
Plasmoid.onActivated: {
|
Plasmoid.onActivated: {
|
||||||
// Always close action drawer
|
|
||||||
if (MobileShell.TopPanelControls.actionDrawerVisible) {
|
|
||||||
MobileShell.TopPanelControls.closeActionDrawer();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Always close the search widget as well
|
|
||||||
if (searchWidget.isOpen) {
|
|
||||||
searchWidget.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
// there's a couple of steps:
|
// there's a couple of steps:
|
||||||
// - minimize windows (only if we are in an app)
|
// - minimize windows (only if we are in an app)
|
||||||
// - open app drawer
|
// - open app drawer
|
||||||
// - close app drawer and, if necessary, restore windows
|
// - close app drawer and, if necessary, restore windows
|
||||||
if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible) {
|
if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible
|
||||||
|
|| MobileShell.TopPanelControls.actionDrawerVisible
|
||||||
|
|| searchWidget.isOpen
|
||||||
|
) {
|
||||||
|
// Always close action drawer
|
||||||
|
if (MobileShell.TopPanelControls.actionDrawerVisible) {
|
||||||
|
MobileShell.TopPanelControls.closeActionDrawer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always close the search widget as well
|
||||||
|
if (searchWidget.isOpen) {
|
||||||
|
searchWidget.close();
|
||||||
|
}
|
||||||
|
|
||||||
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();
|
||||||
|
|
|
||||||
|
|
@ -39,22 +39,25 @@ MobileShell.HomeScreen {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Plasmoid.onActivated: {
|
Plasmoid.onActivated: {
|
||||||
// Always close action drawer
|
|
||||||
if (MobileShell.TopPanelControls.actionDrawerVisible) {
|
|
||||||
MobileShell.TopPanelControls.closeActionDrawer();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Always close the search widget as well
|
|
||||||
if (search.isOpen) {
|
|
||||||
search.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
// there's a couple of steps:
|
// there's a couple of steps:
|
||||||
// - minimize windows (only if we are in an app)
|
// - minimize windows (only if we are in an app)
|
||||||
// - open app drawer
|
// - open app drawer
|
||||||
// - close app drawer and, if necessary, restore windows
|
// - close app drawer and, if necessary, restore windows
|
||||||
if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible) {
|
if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible
|
||||||
|
|| MobileShell.TopPanelControls.actionDrawerVisible
|
||||||
|
|| search.isOpen
|
||||||
|
) {
|
||||||
|
// Always close action drawer
|
||||||
|
if (MobileShell.TopPanelControls.actionDrawerVisible) {
|
||||||
|
MobileShell.TopPanelControls.closeActionDrawer();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always close the search widget as well
|
||||||
|
if (search.isOpen) {
|
||||||
|
search.close();
|
||||||
|
}
|
||||||
|
|
||||||
plasmoid.nativeInterface.showingDesktop = true;
|
plasmoid.nativeInterface.showingDesktop = true;
|
||||||
} else if (homescreen.page == 0) {
|
} else if (homescreen.page == 0) {
|
||||||
homescreen.page = 1;
|
homescreen.page = 1;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue