mirror of
https://github.com/RustyRaptor/deckhud.git
synced 2026-12-03 15:55:16 -07:00
Kirigami's colours did not follow wallpaper-slideshow accent changes on the host or in a sandbox; the portal's accent-color + SettingChanged does, in both. The daemon pushes 'accent' messages; the UI no longer depends on Kirigami. Also record the Flatpak spike (viable). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013UzjWSBjtVZ2zi8fJxS2hH
55 lines
1.8 KiB
QML
55 lines
1.8 KiB
QML
import QtQuick
|
|
import QtCore
|
|
import QtWebSockets
|
|
import org.kde.layershell as LayerShell
|
|
import "components"
|
|
|
|
// Full-screen, click-through overlay. Usage: qml main.qml -- ws://127.0.0.1:PORT/TOKEN
|
|
Window {
|
|
id: window
|
|
|
|
readonly property string daemonUrl: Qt.application.arguments.find(a => a.startsWith("ws://")) ?? ""
|
|
|
|
visible: true
|
|
color: "transparent"
|
|
flags: Qt.FramelessWindowHint | Qt.WindowTransparentForInput | Qt.WindowDoesNotAcceptFocus
|
|
title: "deckhud"
|
|
|
|
LayerShell.Window.scope: "deckhud"
|
|
LayerShell.Window.layer: LayerShell.Window.LayerOverlay
|
|
LayerShell.Window.anchors: LayerShell.Window.AnchorTop | LayerShell.Window.AnchorBottom
|
|
| LayerShell.Window.AnchorLeft | LayerShell.Window.AnchorRight
|
|
LayerShell.Window.keyboardInteractivity: LayerShell.Window.KeyboardInteractivityNone
|
|
LayerShell.Window.exclusionZone: -1
|
|
LayerShell.Window.activateOnShow: false
|
|
|
|
Hud {
|
|
id: hud
|
|
anchors.fill: parent
|
|
iconDir: StandardPaths.writableLocation(StandardPaths.GenericDataLocation)
|
|
+ "/Steam/tenfoot/resource/images/library/controller/binding_icons"
|
|
}
|
|
|
|
WebSocket {
|
|
id: socket
|
|
url: window.daemonUrl
|
|
active: window.daemonUrl !== ""
|
|
onTextMessageReceived: message => hud.handleText(message)
|
|
onStatusChanged: {
|
|
if (socket.status === WebSocket.Error)
|
|
console.warn("deckhud: socket error:", socket.errorString)
|
|
if (socket.status === WebSocket.Error || socket.status === WebSocket.Closed)
|
|
reconnect.restart()
|
|
}
|
|
}
|
|
|
|
Timer {
|
|
id: reconnect
|
|
interval: 1000
|
|
onTriggered: {
|
|
socket.active = false
|
|
socket.active = true
|
|
}
|
|
}
|
|
}
|