some cleanups in the ui

This commit is contained in:
Michael Zanetti 2018-11-27 10:43:56 +01:00
parent bebe246410
commit dcb648addb
5 changed files with 27 additions and 9 deletions

View File

@ -322,7 +322,7 @@ Page {
id: paramRepeater
model: d.deviceDescriptorId == null ? d.deviceClass.paramTypes : null
delegate: ParamDelegate {
Layout.preferredHeight: 60
// Layout.preferredHeight: 60
Layout.fillWidth: true
paramType: d.deviceClass.paramTypes.get(index)
}

View File

@ -17,7 +17,10 @@ ItemDelegate {
}
property bool writable: true
topPadding: 0
bottomPadding: 0
contentItem: ColumnLayout {
id: contentItemColumn
RowLayout {
Label {
Layout.fillWidth: true
@ -167,7 +170,7 @@ ItemDelegate {
ColorPicker {
id: colorPicker
implicitHeight: 200
// color: root.param.value
// color: root.param.value
Binding {
target: colorPicker

View File

@ -101,7 +101,7 @@ DeviceListPageBase {
Label {
Layout.fillWidth: true
text: sensorValueDelegate.stateValue
? "%1 %2".arg(sensorValueDelegate.stateValue.value).arg(sensorValueDelegate.stateType.unitString)
? "%1 %2".arg(Math.round(sensorValueDelegate.stateValue.value * 100) / 100).arg(sensorValueDelegate.stateType.unitString)
: ""
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter

View File

@ -389,7 +389,7 @@ MainPageTile {
// switch (model.name) {
// case "sensor":
// }
return parent.state.value + "°C";
return (Math.round(parent.state.value * 100) / 100) + " °C";
}
}
}

View File

@ -77,11 +77,26 @@ Page {
text: qsTr("Password:")
Layout.fillWidth: true
}
TextField {
Layout.fillWidth: true
text: root.policy ? root.policy.password : ""
onEditingFinished: root.policy.password = text
placeholderText: qsTr("Optional")
RowLayout {
TextField {
id: passwordTextField
Layout.fillWidth: true
text: root.policy ? root.policy.password : ""
onEditingFinished: root.policy.password = text
placeholderText: qsTr("Optional")
echoMode: hiddenPassword ? TextInput.Password : TextInput.Normal
property bool hiddenPassword: true
}
ColorIcon {
Layout.preferredHeight: app.iconSize
Layout.preferredWidth: height
name: "../images/eye.svg"
color: passwordTextField.hiddenPassword ? keyColor : app.accentColor
MouseArea {
anchors.fill: parent
onClicked: passwordTextField.hiddenPassword = !passwordTextField.hiddenPassword
}
}
}
}