Some improvements

This commit is contained in:
Michael Zanetti 2019-06-11 02:40:24 +02:00
parent bd506ea27f
commit d908a7e359
3 changed files with 35 additions and 22 deletions

View File

@ -33,7 +33,7 @@ ItemDelegate {
} }
Loader { Loader {
id: loader id: loader
Layout.fillWidth: sourceComponent === textFieldComponent Layout.fillWidth: true// sourceComponent === textFieldComponent || sourceComponent === stringComponent
sourceComponent: { sourceComponent: {
print("loading paramdelegate:", root.writable, root.paramType.type) print("loading paramdelegate:", root.writable, root.paramType.type)
if (!root.writable) { if (!root.writable) {
@ -93,6 +93,8 @@ ItemDelegate {
} }
return root.param.value; return root.param.value;
} }
horizontalAlignment: Text.AlignRight
elide: Text.ElideRight
} }
} }
Component { Component {
@ -150,26 +152,34 @@ ItemDelegate {
Component { Component {
id: spinnerComponent id: spinnerComponent
SpinBox { RowLayout {
value: root.param.value ? root.param.value : 0 spacing: app.margins
from: root.paramType.minValue
? root.paramType.minValue SpinBox {
: root.paramType.type.toLowerCase() === "uint" value: root.param.value ? root.param.value : 0
? 0 from: root.paramType.minValue
: -2000000000 ? root.paramType.minValue
to: root.paramType.maxValue : root.paramType.type.toLowerCase() === "uint"
? root.paramType.maxValue ? 0
: 2000000000 : -2000000000
editable: true to: root.paramType.maxValue
width: 150 ? root.paramType.maxValue
onValueModified: root.param.value = value : 2000000000
textFromValue: function(value) { editable: true
return value width: 150
} onValueModified: root.param.value = value
Component.onCompleted: { textFromValue: function(value) {
if (root.value === undefined) { return value
root.value = value
} }
Component.onCompleted: {
if (root.value === undefined) {
root.value = value
}
}
}
Label {
text: root.paramType.unitString
visible: text.length > 0
} }
} }
} }

View File

@ -68,8 +68,10 @@ Page {
Flickable { Flickable {
anchors.fill: parent anchors.fill: parent
contentHeight: contentColumn.implicitHeight
ColumnLayout { ColumnLayout {
id: contentColumn
width: parent.width width: parent.width
Label { Label {
@ -156,7 +158,8 @@ Page {
Layout.leftMargin: app.margins Layout.leftMargin: app.margins
Layout.rightMargin: app.margins Layout.rightMargin: app.margins
text: qsTr("Apply") text: qsTr("Apply")
visible: settingsRepeater.dirty enabled: settingsRepeater.dirty
visible: settingsRepeater.count > 0
onClicked: { onClicked: {
var params = [] var params = []

View File

@ -45,7 +45,7 @@
application still try to draw after application still try to draw after
"applicationStateChanged(Qt::ApplicationSuspended)" "applicationStateChanged(Qt::ApplicationSuspended)"
signal is sent! --> signal is sent! -->
<meta-data android:name="android.app.background_running" android:value="false"/> <meta-data android:name="android.app.background_running" android:value="true"/>
<!-- Background running --> <!-- Background running -->
<!-- auto screen scale factor --> <!-- auto screen scale factor -->