Make dashboard wizard usable on small screens

pull/1067/head
Michael Zanetti 2023-10-11 23:50:23 +02:00
parent d4ee1af24b
commit a84c7905d5
2 changed files with 73 additions and 51 deletions

View File

@ -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))

View File

@ -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)
}
}
}
}