Compare commits

...

2 commits

Author SHA1 Message Date
Carl Schwan
df690b8d20 remove hack and don't hardcode font 2020-09-19 14:58:29 +02:00
Carl Schwan
3118be5c98 Use Kirigami header in sidebar 2020-09-19 11:07:31 +02:00

View file

@ -35,43 +35,54 @@ Kirigami.ApplicationWindow
modal: !root.wideScreen modal: !root.wideScreen
handleVisible: !root.wideScreen handleVisible: !root.wideScreen
header: Kirigami.AbstractApplicationHeader {
topPadding: Kirigami.Units.smallSpacing
bottomPadding: Kirigami.Units.smallSpacing
leftPadding: Kirigami.Units.smallSpacing
rightPadding: Kirigami.Units.smallSpacing
contentItem: RowLayout {
anchors.fill: parent
spacing: Kirigami.Units.smallSpacing
DBusProperty {
id: announcedNameProperty
object: DaemonDbusInterface
read: "announcedName"
defaultValue: ""
}
TextField {
id: nameField
visible: false
Layout.fillWidth: true
text: announcedNameProperty.value
onAccepted: {
DaemonDbusInterface.setAnnouncedName(text)
text = Qt.binding(function() {return announcedNameProperty.value})
}
}
Kirigami.Heading {
level: 1
text: announcedNameProperty.value
Layout.fillWidth: true
visible: !nameField.visible
elide: Qt.ElideRight
}
Button {
icon.name: nameField.visible ? "dialog-ok-apply" : "entry-edit"
onClicked: {
nameField.visible = !nameField.visible
nameField.accepted()
}
}
}
}
topContent: RowLayout { topContent: RowLayout {
width: parent.width width: parent.width
DBusProperty {
id: announcedNameProperty
object: DaemonDbusInterface
read: "announcedName"
defaultValue: ""
}
TextField {
id: nameField
visible: false
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.smallSpacing
text: announcedNameProperty.value
onAccepted: {
DaemonDbusInterface.setAnnouncedName(text)
text = Qt.binding(function() {return announcedNameProperty.value})
}
}
Label {
text: announcedNameProperty.value
visible: !nameField.visible
Layout.fillWidth: true
elide: Qt.ElideRight
font.pointSize: 18
Layout.leftMargin: Kirigami.Units.smallSpacing
}
Button {
icon.name: nameField.visible ? "dialog-ok-apply" : "entry-edit"
onClicked: {
nameField.visible = !nameField.visible
nameField.accepted()
}
}
} }
property var objects: [findDevicesAction] property var objects: [findDevicesAction]