shift-shell/containments/homescreens/folio/qml/gaming/GamingHUD.qml
Marco Allegretti 6ac9c58d93 Add Game Center overlay
Full-screen layer-shell overlay containing a game library grid
(XDG Game category, filtered via ApplicationListSearchModel) and
a panel of running tasks built on TaskManager.TasksModel.

Keyboard-navigable with directional focus between the running
tasks row and the game grid. A persistent HUD button lets the
user return after launching a game. Exiting gaming mode requires
an explicit confirmation dialog.

The overlay is a Window with LayerShell.LayerTop so it sits above
running application windows without covering system notifications.
2026-04-19 13:51:20 +02:00

49 lines
1.5 KiB
QML

// SPDX-FileCopyrightText: 2026 Marco Allegretti
// SPDX-License-Identifier: EUPL-1.2
import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Window
import org.kde.kirigami as Kirigami
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
import org.kde.layershell 1.0 as LayerShell
Window {
id: root
signal openRequested()
width: Kirigami.Units.gridUnit * 4
height: Kirigami.Units.gridUnit * 2
color: "transparent"
flags: Qt.FramelessWindowHint
LayerShell.Window.scope: "gaming-hud"
LayerShell.Window.layer: LayerShell.Window.LayerOverlay
LayerShell.Window.anchors: LayerShell.Window.AnchorTop | LayerShell.Window.AnchorRight
LayerShell.Window.exclusionZone: 0
LayerShell.Window.keyboardInteractivity: LayerShell.Window.KeyboardInteractivityNone
opacity: visible ? 1 : 0
Behavior on opacity {
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad }
}
Rectangle {
anchors.fill: parent
anchors.margins: Kirigami.Units.smallSpacing
radius: height / 2
color: Qt.rgba(0, 0, 0, 0.55)
QQC2.ToolButton {
anchors.centerIn: parent
icon.name: "input-gaming"
icon.color: "white"
display: QQC2.AbstractButton.IconOnly
QQC2.ToolTip.visible: hovered
QQC2.ToolTip.text: i18n("Game Center")
onClicked: root.openRequested()
}
}
}