diff --git a/nymea-app/ui/delegates/SensorListDelegate.qml b/nymea-app/ui/delegates/SensorListDelegate.qml index b5fe58e7..e4d5e06a 100644 --- a/nymea-app/ui/delegates/SensorListDelegate.qml +++ b/nymea-app/ui/delegates/SensorListDelegate.qml @@ -42,6 +42,11 @@ BigThingTile { id: dataGrid columns: Math.floor(contentItem.width / 120) + Connections { + target: itemDelegate + onThingChanged: stateModel.update() + } + ListModel { id: interfacesModel ListElement { interfaceName: "temperaturesensor"; stateName: "temperature" } @@ -74,8 +79,13 @@ BigThingTile { } Repeater { model: ListModel { + id: stateModel dynamicRoles: true Component.onCompleted: { + update() + } + + function update() { for (var i = 0; i < interfacesModel.count; i++) { if (itemDelegate.thing.thingClass.interfaces.indexOf(interfacesModel.get(i).interfaceName) >= 0) { append(interfacesModel.get(i)) diff --git a/nymea-app/ui/mainviews/dashboard/DashboardAddWizard.qml b/nymea-app/ui/mainviews/dashboard/DashboardAddWizard.qml index 73d7199b..7a96160c 100644 --- a/nymea-app/ui/mainviews/dashboard/DashboardAddWizard.qml +++ b/nymea-app/ui/mainviews/dashboard/DashboardAddWizard.qml @@ -57,63 +57,75 @@ NymeaDialog { implicitHeight: currentItem.implicitHeight clip: true - initialItem: ColumnLayout { - id: contentColumn - implicitHeight: childrenRect.height - NymeaItemDelegate { - Layout.fillWidth: true - text: qsTr("Thing") - iconName: "things" - onClicked: { - internalPageStack.push(addThingSelectionComponent) + initialItem: Flickable { + id: flickable + width: internalPageStack.width + implicitHeight: contentColumn.implicitHeight + contentHeight: contentColumn.implicitHeight + contentWidth: width + + ScrollBar.vertical: ScrollBar {} + + ColumnLayout { + id: contentColumn + width: flickable.width + implicitHeight: childrenRect.height + + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Thing") + iconName: "things" + onClicked: { + internalPageStack.push(addThingSelectionComponent) + } } - } - NymeaItemDelegate { - Layout.fillWidth: true - iconName: "sensors" - text: qsTr("Sensor") - onClicked: { - internalPageStack.push(addSensorComponent) + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Sensor") + iconName: "sensors" + onClicked: { + internalPageStack.push(addSensorComponent) + } } - } - NymeaItemDelegate { - Layout.fillWidth: true - iconName: "folder" - text: qsTr("Folder") - onClicked: { - internalPageStack.push(addFolderComponent) + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("State") + iconName: "state" + onClicked: { + internalPageStack.push(addStateSelectThingComponent) + } } - } - NymeaItemDelegate { - Layout.fillWidth: true - text: qsTr("State") - iconName: "state" - onClicked: { - internalPageStack.push(addStateSelectThingComponent) + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Chart") + iconName: "chart" + onClicked: { + internalPageStack.push(addGraphSelectThingComponent) + } } - } - NymeaItemDelegate { - Layout.fillWidth: true - text: qsTr("Chart") - iconName: "chart" - onClicked: { - internalPageStack.push(addGraphSelectThingComponent) + NymeaItemDelegate { + Layout.fillWidth: true + iconName: "folder" + text: qsTr("Folder") + onClicked: { + internalPageStack.push(addFolderComponent) + } } - } - NymeaItemDelegate { - Layout.fillWidth: true - text: qsTr("Scene") - iconName: "slideshow" - onClicked: { - internalPageStack.push(addSceneComponent) + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Scene") + iconName: "slideshow" + onClicked: { + internalPageStack.push(addSceneComponent) + } } - } - NymeaItemDelegate { - Layout.fillWidth: true - text: qsTr("Web view") - iconName: "stock_website" - onClicked: { - internalPageStack.push(addWebViewComponent) + NymeaItemDelegate { + Layout.fillWidth: true + text: qsTr("Web view") + iconName: "stock_website" + onClicked: { + internalPageStack.push(addWebViewComponent) + } } } }