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 id: paramRepeater
model: d.deviceDescriptorId == null ? d.deviceClass.paramTypes : null model: d.deviceDescriptorId == null ? d.deviceClass.paramTypes : null
delegate: ParamDelegate { delegate: ParamDelegate {
Layout.preferredHeight: 60 // Layout.preferredHeight: 60
Layout.fillWidth: true Layout.fillWidth: true
paramType: d.deviceClass.paramTypes.get(index) paramType: d.deviceClass.paramTypes.get(index)
} }

View File

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

View File

@ -101,7 +101,7 @@ DeviceListPageBase {
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: sensorValueDelegate.stateValue 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 elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter

View File

@ -389,7 +389,7 @@ MainPageTile {
// switch (model.name) { // switch (model.name) {
// case "sensor": // 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:") text: qsTr("Password:")
Layout.fillWidth: true Layout.fillWidth: true
} }
TextField { RowLayout {
Layout.fillWidth: true TextField {
text: root.policy ? root.policy.password : "" id: passwordTextField
onEditingFinished: root.policy.password = text Layout.fillWidth: true
placeholderText: qsTr("Optional") 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
}
}
} }
} }