This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-app/nymea-app/ui/components/ThingStatusIcons.qml
Michael Zanetti e6d4af8556 UI refresh
2020-11-28 13:42:42 +01:00

47 lines
1.7 KiB
QML

import QtQuick 2.9
import QtQuick.Layouts 1.1
import Nymea 1.0
RowLayout {
id: root
Layout.fillWidth: false
property Thing thing: null
property color color: keyColor
readonly property color keyColor: updateStatusIcon.keyColor
UpdateStatusIcon {
id: updateStatusIcon
Layout.preferredHeight: app.smallIconSize
Layout.preferredWidth: height
thing: root.thing
visible: updateAvailable || updateRunning
Binding { target: updateStatusIcon; property: "color"; value: root.color; when: root.color !== root.keyColor }
}
BatteryStatusIcon {
id: batteryStatusIcon
Layout.preferredHeight: app.smallIconSize
Layout.preferredWidth: height
thing: root.thing
visible: root.thing.setupStatus == Thing.ThingSetupStatusComplete && (hasBatteryLevel || isCritical)
Binding { target: batteryStatusIcon; property: "color"; value: root.color; when: root.color !== root.keyColor }
}
ConnectionStatusIcon {
id: connectionStatusIcon
Layout.preferredHeight: app.smallIconSize
Layout.preferredWidth: height
thing: root.thing
visible: root.thing.setupStatus == Thing.ThingSetupStatusComplete && (hasSignalStrength || !isConnected)
Binding { target: connectionStatusIcon; property: "color"; value: root.color; when: root.color !== root.keyColor }
}
SetupStatusIcon {
id: setupStatusIcon
Layout.preferredHeight: app.smallIconSize
Layout.preferredWidth: height
thing: root.thing
visible: setupFailed || setupInProgress
Binding { target: setupStatusIcon; property: "color"; value: root.color; when: root.color !== root.keyColor }
}
}