2022-04-07 18:11:08 +00:00
|
|
|
/*
|
|
|
|
|
* 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
|
2024-11-08 04:06:22 +00:00
|
|
|
import QtQuick.Window
|
2022-04-07 18:11:08 +00:00
|
|
|
|
2024-11-14 03:31:10 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2022-04-07 18:11:08 +00:00
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
|
|
|
|
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
|
2024-11-08 04:06:22 +00:00
|
|
|
import org.kde.layershell 1.0 as LayerShell
|
2022-04-07 18:11:08 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Window with the ActionDrawer component embedded in it.
|
2024-07-27 03:47:44 +00:00
|
|
|
*
|
2022-04-07 18:11:08 +00:00
|
|
|
* Used for overlaying the ActionDrawer if the original window does not cover
|
|
|
|
|
* the whole screen.
|
|
|
|
|
*/
|
2024-11-08 04:06:22 +00:00
|
|
|
Window {
|
2022-04-07 18:11:08 +00:00
|
|
|
id: window
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2024-11-08 04:06:22 +00:00
|
|
|
LayerShell.Window.scope: "overlay"
|
|
|
|
|
LayerShell.Window.anchors: LayerShell.Window.AnchorTop | LayerShell.Window.AnchorLeft | LayerShell.Window.AnchorRight | LayerShell.Window.AnchorBottom
|
|
|
|
|
LayerShell.Window.layer: LayerShell.Window.LayerOverlay
|
|
|
|
|
LayerShell.Window.exclusionZone: -1
|
|
|
|
|
LayerShell.Window.keyboardInteractivity: LayerShell.Window.KeyboardInteractivityNone
|
|
|
|
|
|
2022-04-07 18:11:08 +00:00
|
|
|
/**
|
|
|
|
|
* The ActionDrawer component.
|
|
|
|
|
*/
|
|
|
|
|
property alias actionDrawer: drawer
|
2024-11-14 03:31:10 +00:00
|
|
|
property alias state: drawer.state
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2024-11-25 17:30:47 +00:00
|
|
|
visible: drawer.intendedToBeVisible
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2022-04-07 18:11:08 +00:00
|
|
|
color: "transparent"
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2024-11-25 17:30:47 +00:00
|
|
|
// set input to transparent when closing to prevent window from taking unwanted touch inputs
|
2026-01-05 01:47:35 +00:00
|
|
|
onStateChanged: MobileShell.ShellUtil.setInputTransparent(window, state === "close")
|
2024-11-14 03:31:10 +00:00
|
|
|
|
2024-11-25 17:30:47 +00:00
|
|
|
onVisibleChanged: {
|
|
|
|
|
if (visible) {
|
2024-07-28 19:55:58 +00:00
|
|
|
window.raise();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-07 18:11:08 +00:00
|
|
|
onActiveChanged: {
|
|
|
|
|
if (!active) {
|
|
|
|
|
drawer.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2022-04-07 18:11:08 +00:00
|
|
|
ActionDrawer {
|
|
|
|
|
id: drawer
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
}
|
|
|
|
|
}
|