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 {
id: loader
Layout.fillWidth: sourceComponent === textFieldComponent
Layout.fillWidth: true// sourceComponent === textFieldComponent || sourceComponent === stringComponent
sourceComponent: {
print("loading paramdelegate:", root.writable, root.paramType.type)
if (!root.writable) {
@ -93,6 +93,8 @@ ItemDelegate {
}
return root.param.value;
}
horizontalAlignment: Text.AlignRight
elide: Text.ElideRight
}
}
Component {
@ -150,26 +152,34 @@ ItemDelegate {
Component {
id: spinnerComponent
SpinBox {
value: root.param.value ? root.param.value : 0
from: root.paramType.minValue
? root.paramType.minValue
: root.paramType.type.toLowerCase() === "uint"
? 0
: -2000000000
to: root.paramType.maxValue
? root.paramType.maxValue
: 2000000000
editable: true
width: 150
onValueModified: root.param.value = value
textFromValue: function(value) {
return value
}
Component.onCompleted: {
if (root.value === undefined) {
root.value = value
RowLayout {
spacing: app.margins
SpinBox {
value: root.param.value ? root.param.value : 0
from: root.paramType.minValue
? root.paramType.minValue
: root.paramType.type.toLowerCase() === "uint"
? 0
: -2000000000
to: root.paramType.maxValue
? root.paramType.maxValue
: 2000000000
editable: true
width: 150
onValueModified: root.param.value = value
textFromValue: function(value) {
return 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 {
anchors.fill: parent
contentHeight: contentColumn.implicitHeight
ColumnLayout {
id: contentColumn
width: parent.width
Label {
@ -156,7 +158,8 @@ Page {
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
text: qsTr("Apply")
visible: settingsRepeater.dirty
enabled: settingsRepeater.dirty
visible: settingsRepeater.count > 0
onClicked: {
var params = []

View File

@ -45,7 +45,7 @@
application still try to draw after
"applicationStateChanged(Qt::ApplicationSuspended)"
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 -->
<!-- auto screen scale factor -->