Improve closable list pages

This commit is contained in:
Michael Zanetti 2018-12-18 01:01:17 +01:00
parent 85d68b562d
commit c5703bb10b
8 changed files with 48 additions and 7 deletions

View File

@ -78,6 +78,11 @@
<file>ui/devicepages/LightDevicePage.qml</file>
<file>ui/devicepages/FingerprintReaderDevicePage.qml</file>
<file>ui/devicelistpages/GenericDeviceListPage.qml</file>
<file>ui/devicelistpages/ClosablesDeviceListPage.qml</file>
<file>ui/devicelistpages/GarageDeviceListPage.qml</file>
<file>ui/devicelistpages/AwningDeviceListPage.qml</file>
<file>ui/devicelistpages/ShutterDeviceListPage.qml</file>
<file>ui/devicelistpages/BlindDeviceListPage.qml</file>
<file>ui/devicelistpages/LightsDeviceListPage.qml</file>
<file>ui/devicelistpages/SensorsDeviceListPage.qml</file>
<file>ui/devicelistpages/WeatherDeviceListPage.qml</file>
@ -138,6 +143,5 @@
<file>ui/system/MqttPolicyPage.qml</file>
<file>ui/devicepages/DeviceLogPage.qml</file>
<file>ui/components/Led.qml</file>
<file>ui/devicelistpages/ClosablesDeviceListPage.qml</file>
</qresource>
</RCC>

View File

@ -175,6 +175,7 @@ ApplicationWindow {
return Qt.resolvedUrl("images/DeviceIconBlind.svg")
case "garagegate":
return Qt.resolvedUrl("images/shutter/shutter-100.svg")
case "awning":
case "extendedawning":
return Qt.resolvedUrl("images/awning/awning-100.svg")
case "battery":

View File

@ -0,0 +1,7 @@
import QtQuick 2.9
ClosablesDeviceListPage {
title: qsTr("Awnings")
iconBasename: "../images/awning/awning"
invertControls: true
}

View File

@ -0,0 +1,6 @@
import QtQuick 2.9
ClosablesDeviceListPage {
title: qsTr("Blinds")
iconBasename: "../images/shutter/shutter"
}

View File

@ -9,6 +9,10 @@ import "../components"
DeviceListPageBase {
id: root
property string iconBasename
property bool invertControls: false
header: GuhHeader {
id: header
onBackPressed: pageStack.pop()
@ -82,8 +86,8 @@ DeviceListPageBase {
? app.accentColor
: keyColor
name: itemDelegate.percentageStateType
? "../images/shutter/shutter-" + app.pad(Math.round(itemDelegate.percentageState.value / 10) * 10, 3) + ".svg"
: "../images/shutter/shutter-050.svg"
? root.iconBasename + "-" + app.pad(Math.round(itemDelegate.percentageState.value / 10) * 10, 3) + ".svg"
: root.iconBasename + "-050.svg"
}
}
@ -101,6 +105,7 @@ DeviceListPageBase {
id: shutterControls
height: parent.height
device: itemDelegate.device
invert: root.invertControls
}
}
}

View File

@ -0,0 +1,6 @@
import QtQuick 2.9
ClosablesDeviceListPage {
title: qsTr("Garage gates")
iconBasename: "../images/shutter/shutter"
}

View File

@ -0,0 +1,6 @@
import QtQuick 2.9
ClosablesDeviceListPage {
title: qsTr("Shutters")
iconBasename: "../images/shutter/shutter"
}

View File

@ -28,14 +28,20 @@ MainPageTile {
case "smartmeter":
page ="SmartMeterDeviceListPage.qml";
break;
case "awning":
case "blind":
case "shutter":
case "garagegate":
page = "GarageDeviceListPage.qml";
break;
case "awning":
case "extendedAwning":
page = "AwningDeviceListPage.qml";
break;
case "blind":
case "extendedBlind":
page = "ShutterDeviceListPage.qml";
break;
case "shutter":
case "extendedShutter":
page = "ClosablesDeviceListPage.qml";
page = "ShutterDeviceListPage.qml";
break;
default:
page = "GenericDeviceListPage.qml"