shift-shell/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml
Devin Lin 76882f5b5d actiondrawer: Share components between portrait and landscape
This avoids having to completely load the quicksettings, status bar,
media widget, and notifications list from scratch when the view changes.
We now have a single instance of each component which is reparented to
the new view (portrait/landscape).

Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/406
2024-10-31 15:27:00 +00:00

51 lines
1,018 B
QML

/*
* SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
/**
* Window with the ActionDrawer component embedded in it.
*
* Used for overlaying the ActionDrawer if the original window does not cover
* the whole screen.
*/
NanoShell.FullScreenOverlay {
id: window
/**
* The ActionDrawer component.
*/
property alias actionDrawer: drawer
visible: drawer.intendedToBeVisible
width: Screen.width
height: Screen.height
color: "transparent"
onVisibleChanged: {
if (visible) {
window.raise();
}
}
onActiveChanged: {
if (!active) {
drawer.close();
}
}
ActionDrawer {
id: drawer
anchors.fill: parent
}
}