ca36b15af1
- 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
38 lines
870 B
QML
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
|
|
}
|
|
}
|
|
}
|