Files
elgato-cli/plasmoid/at.sub-net.elgato/contents/ui/CompactRepresentation.qml
T
tina.schellander ca36b15af1 Initial implementation: CLI + KDE Plasma 6 widget for Elgato Key Light
- Python CLI (click): discover, status, on/off/toggle, brightness, temperature, info
- mDNS discovery via zeroconf for automatic light detection
- Shared config at ~/.config/elgato-cli/config.json
- KDE Plasma 6 plasmoid with system tray icon, power/brightness/temperature controls
- Plasmoid uses XMLHttpRequest directly to light API (no CLI dependency)
- Unit tests for API client with mocked HTTP responses
2026-02-07 11:14:01 +01:00

38 lines
870 B
QML

import QtQuick
import org.kde.plasma.core as PlasmaCore
import org.kde.kirigami as Kirigami
MouseArea {
id: compactRoot
property bool wasExpanded: false
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
Kirigami.Icon {
anchors.fill: parent
source: {
if (root.lightHost === "" || !root.lightReachable)
return "network-disconnect"
return root.lightOn ? "brightness-high" : "brightness-low"
}
active: compactRoot.containsMouse
}
hoverEnabled: true
onPressed: function(mouse) {
if (mouse.button === Qt.MiddleButton) {
root.toggleLight()
} else {
wasExpanded = root.expanded
}
}
onClicked: function(mouse) {
if (mouse.button === Qt.LeftButton) {
root.expanded = !wasExpanded
}
}
}