From 0595f69817bf2e54255c9089d3bef328fdd797fb Mon Sep 17 00:00:00 2001 From: Martin Lukas Date: Tue, 10 Sep 2024 10:14:43 +0200 Subject: [PATCH] Update new page after review Signed-off-by: Martin Lukas --- nymea-app/ui/components/ThingInfoPane.qml | 2 +- nymea-app/ui/devicepages/DeviceDetailsPage.qml | 12 +++++++++++- .../ui/thingconfiguration/ConfigureThingPage.qml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/nymea-app/ui/components/ThingInfoPane.qml b/nymea-app/ui/components/ThingInfoPane.qml index 58126561..161255b6 100644 --- a/nymea-app/ui/components/ThingInfoPane.qml +++ b/nymea-app/ui/components/ThingInfoPane.qml @@ -13,7 +13,7 @@ InfoPaneBase { readonly property bool setupFailure: root.thing.setupStatus == Thing.ThingSetupStatusFailed readonly property State batteryState: root.thing.stateByName("batteryLevel") readonly property State batteryCriticalState: root.thing.stateByName("batteryCritical") - readonly property bool connectedState: root.thing.thingClass.interfaces.indexOf("connectable") >= 0 && root.thing.stateByName("connected") + readonly property State connectedState: root.thing.thingClass.interfaces.indexOf("connectable") >= 0 ? root.thing.stateByName("connected") : null readonly property State signalStrengthState: root.thing.stateByName("signalStrength") readonly property State updateStatusState: root.thing.stateByName("updateStatus") readonly property State childLockState: root.thing.stateByName("childLock") diff --git a/nymea-app/ui/devicepages/DeviceDetailsPage.qml b/nymea-app/ui/devicepages/DeviceDetailsPage.qml index d3ad2d9f..fd7a4e03 100644 --- a/nymea-app/ui/devicepages/DeviceDetailsPage.qml +++ b/nymea-app/ui/devicepages/DeviceDetailsPage.qml @@ -6,9 +6,18 @@ import Nymea 1.0 import "../components" import "../delegates" -ThingPageBase { +Page { id: root + property Thing thing: null + + header: NymeaHeader { + text: thing ? thing.name : "" + backButtonVisible: true + onBackPressed: pageStack.pop() + } + + ListView { id: flickable anchors.fill: parent @@ -30,6 +39,7 @@ ThingPageBase { model: ThingModel { thing: root.thing + showActions: false } delegate: SwipeDelegate { id: delegate diff --git a/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml b/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml index 40c634d4..b01b7d30 100644 --- a/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml +++ b/nymea-app/ui/thingconfiguration/ConfigureThingPage.qml @@ -94,7 +94,7 @@ SettingsPageBase { } function thingDetails() { - var detailsPage = pageStack.push(Qt.resolvedUrl("qrc:/ui/devicepages/DeviceDetailsPage.qml"), {thing: root.thing}) + pageStack.push(Qt.resolvedUrl("qrc:/ui/devicepages/DeviceDetailsPage.qml"), {thing: root.thing}) } Component {