Merge PR #528: Tweak plugin settings pages

This commit is contained in:
Jenkins nymea 2021-02-12 23:56:47 +01:00
commit 7600788aad
2 changed files with 16 additions and 25 deletions

View File

@ -36,12 +36,12 @@ import "../components"
import "../delegates"
import Nymea 1.0
Page {
SettingsPageBase {
id: root
property var plugin: null
header: NymeaHeader {
text: qsTr("%1 settings").arg(plugin.name)
text: plugin.name
backButtonVisible: true
onBackPressed: pageStack.pop()
@ -66,23 +66,17 @@ Page {
}
}
Flickable {
anchors.fill: parent
contentHeight: column.implicitHeight
SettingsPageSectionHeader {
text: qsTr("Settings")
}
ColumnLayout {
id: column
width: parent.width
Repeater {
model: plugin.paramTypes
Repeater {
model: plugin.paramTypes
delegate: ParamDelegate {
Layout.fillWidth: true
paramType: root.plugin.paramTypes.get(index)
param: root.plugin.params.getParam(model.id)
}
}
delegate: ParamDelegate {
Layout.fillWidth: true
paramType: root.plugin.paramTypes.get(index)
param: root.plugin.params.getParam(model.id)
}
}

View File

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Copyright 2013 - 2020, nymea GmbH
* Copyright 2013 - 2021, nymea GmbH
* Contact: contact@nymea.io
*
* This file is part of nymea.
@ -51,11 +51,8 @@ SettingsPageBase {
}
}
Label {
Layout.fillWidth: true
Layout.margins: app.margins
wrapMode: Text.WordWrap
text: qsTr("This list shows the list of installed plugins on this %1 system.").arg(app.systemName)
SettingsPageSectionHeader {
text: qsTr("Installed integration plugins")
}
Repeater {
@ -66,11 +63,11 @@ SettingsPageBase {
delegate: NymeaSwipeDelegate {
Layout.fillWidth: true
property var plugin: pluginsProxy.get(index)
property Plugin plugin: pluginsProxy.get(index)
iconName: "../images/plugin.svg"
text: model.name
progressive: plugin.paramTypes.count > 0
onClicked: pageStack.push(Qt.resolvedUrl("PluginParamsPage.qml"), {plugin: plugin})
onClicked: if (progressive) { pageStack.push(Qt.resolvedUrl("PluginParamsPage.qml"), {plugin: plugin}) }
}
}
}