Fix background of device name on Plasma Mobile

This commit is contained in:
Nicolas Fella 2019-10-15 20:13:17 +02:00
parent 8d8989ea09
commit f58a99e388

View file

@ -49,45 +49,44 @@ Kirigami.ApplicationWindow
modal: !root.wideScreen modal: !root.wideScreen
handleVisible: !root.wideScreen handleVisible: !root.wideScreen
topContent: Kirigami.AbstractApplicationHeader { topContent: RowLayout {
RowLayout { width: parent.width
width: parent.width DBusProperty {
DBusProperty { id: announcedNameProperty
id: announcedNameProperty object: DaemonDbusInterface
object: DaemonDbusInterface read: "announcedName"
read: "announcedName" defaultValue: ""
defaultValue: "" }
}
TextField { TextField {
id: nameField id: nameField
visible: false visible: false
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.smallSpacing Layout.leftMargin: Kirigami.Units.smallSpacing
text: announcedNameProperty.value text: announcedNameProperty.value
onAccepted: { onAccepted: {
DaemonDbusInterface.setAnnouncedName(text) DaemonDbusInterface.setAnnouncedName(text)
text = Qt.binding(function() {return announcedNameProperty.value}) text = Qt.binding(function() {return announcedNameProperty.value})
}
} }
}
Label { Label {
text: announcedNameProperty.value text: announcedNameProperty.value
visible: !nameField.visible visible: !nameField.visible
Layout.fillWidth: true Layout.fillWidth: true
font.pointSize: 18 font.pointSize: 18
Layout.leftMargin: Kirigami.Units.smallSpacing Layout.leftMargin: Kirigami.Units.smallSpacing
} }
Button { Button {
icon.name: nameField.visible ? "dialog-ok-apply" : "entry-edit" icon.name: nameField.visible ? "dialog-ok-apply" : "entry-edit"
onClicked: { onClicked: {
nameField.visible = !nameField.visible nameField.visible = !nameField.visible
nameField.accepted() nameField.accepted()
}
} }
} }
} }
property var objects: [findDevicesAction] property var objects: [findDevicesAction]
Instantiator { Instantiator {
model: DevicesSortProxyModel { model: DevicesSortProxyModel {