diff --git a/nymea-app/ui/devicelistpages/MediaDeviceListPage.qml b/nymea-app/ui/devicelistpages/MediaDeviceListPage.qml index 47b0d159..72d1f6f5 100644 --- a/nymea-app/ui/devicelistpages/MediaDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/MediaDeviceListPage.qml @@ -47,20 +47,22 @@ DeviceListPageBase { Flickable { anchors.fill: parent contentHeight: contentGrid.implicitHeight + topMargin: app.margins / 2 GridLayout { id: contentGrid - width: parent.width - columns: Math.ceil(width / 500) + width: parent.width - app.margins + anchors.horizontalCenter: parent.horizontalCenter + columns: Math.ceil(width / 600) rowSpacing: 0 columnSpacing: 0 - Repeater { model: root.devicesProxy - delegate: ItemDelegate { + delegate: Item { id: itemDelegate Layout.preferredWidth: contentGrid.width / contentGrid.columns + height: contentItem.implicitHeight + app.margins property bool inline: width > 500 @@ -72,9 +74,10 @@ DeviceListPageBase { readonly property StateType playerTypeStateType: thing.thingClass.stateTypes.findByName("playerType") readonly property State playerTypeState: thing.stateByName("playerType") - bottomPadding: index === root.devicesProxy.count - 1 ? topPadding : 0 - contentItem: Pane { + Pane { id: contentItem + width: parent.width - app.margins + anchors.centerIn: parent Material.elevation: 2 leftPadding: 0 rightPadding: 0 diff --git a/nymea-app/ui/devicelistpages/SensorsDeviceListPage.qml b/nymea-app/ui/devicelistpages/SensorsDeviceListPage.qml index a9fd6e2c..a9654bcb 100644 --- a/nymea-app/ui/devicelistpages/SensorsDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/SensorsDeviceListPage.qml @@ -39,25 +39,29 @@ DeviceListPageBase { id: root header: NymeaHeader { - text: qsTr("Sensors") + text: root.shownInterfaces.indexOf("heating") >= 0 ? qsTr("Heating") : qsTr("Sensors") onBackPressed: pageStack.pop() } ListView { anchors.fill: parent model: root.thingsProxy + topMargin: app.margins / 2 - delegate: ItemDelegate { + delegate: Item { id: itemDelegate - width: parent.width + width: parent.width - app.margins + anchors.horizontalCenter: parent.horizontalCenter + height: contentItem.implicitHeight + app.margins property bool inline: width > 500 property Thing thing: thingsProxy.getThing(model.id) - bottomPadding: index === ListView.view.count - 1 ? topPadding : 0 - contentItem: Pane { + Pane { id: contentItem + width: parent.width - app.margins + anchors.centerIn: parent Material.elevation: 2 leftPadding: 0 rightPadding: 0 @@ -173,7 +177,7 @@ DeviceListPageBase { } Led { id: led - visible: ["presencesensor", "daylightsensor"].indexOf(model.interfaceName) >= 0 + visible: ["presencesensor", "daylightsensor", "heating"].indexOf(model.interfaceName) >= 0 state: visible && sensorValueDelegate.stateValue.value === true ? "on" : "off" } Item { diff --git a/nymea-app/ui/devicelistpages/SmartMeterDeviceListPage.qml b/nymea-app/ui/devicelistpages/SmartMeterDeviceListPage.qml index 9cd3be70..4ba056e8 100644 --- a/nymea-app/ui/devicelistpages/SmartMeterDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/SmartMeterDeviceListPage.qml @@ -46,18 +46,22 @@ DeviceListPageBase { ListView { anchors.fill: parent model: root.devicesProxy + topMargin: app.margins / 2 - delegate: ItemDelegate { + delegate: Item { id: itemDelegate - width: parent.width + width: parent.width - app.margins + anchors.horizontalCenter: parent.horizontalCenter + height: contentItem.height + app.margins property bool inline: width > 500 property Thing thing: thingsProxy.getThing(model.id) - bottomPadding: index === ListView.view.count - 1 ? topPadding : 0 - contentItem: Pane { + Pane { id: contentItem + width: parent.width - app.margins + anchors.centerIn: parent Material.elevation: 2 leftPadding: 0 rightPadding: 0 diff --git a/nymea-app/ui/devicelistpages/WeatherDeviceListPage.qml b/nymea-app/ui/devicelistpages/WeatherDeviceListPage.qml index 8166bd36..910a4d5f 100644 --- a/nymea-app/ui/devicelistpages/WeatherDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/WeatherDeviceListPage.qml @@ -47,19 +47,23 @@ DeviceListPageBase { ListView { anchors.fill: parent model: root.devicesProxy + topMargin: app.margins / 2 - delegate: ItemDelegate { + delegate: Item { id: itemDelegate - width: parent.width + width: parent.width - app.margins + height: contentItem.height + app.margins + anchors.horizontalCenter: parent.horizontalCenter property bool inline: width > 500 property Device device: devicesProxy.getDevice(model.id) property DeviceClass deviceClass: device.deviceClass - bottomPadding: index === ListView.view.count - 1 ? topPadding : 0 - contentItem: Pane { + Pane { id: contentItem + width: parent.width - app.margins + anchors.centerIn: parent Material.elevation: 2 leftPadding: 0 rightPadding: 0