Commit 21f0227e authored by Carl Schwan's avatar Carl Schwan 🚴 Committed by Nicolas Fella
Browse files

Use Kirigami header in sidebar

parent e57fd79f
Pipeline #34814 canceled with stage
...@@ -35,41 +35,48 @@ Kirigami.ApplicationWindow ...@@ -35,41 +35,48 @@ Kirigami.ApplicationWindow
modal: !root.wideScreen modal: !root.wideScreen
handleVisible: !root.wideScreen handleVisible: !root.wideScreen
topContent: RowLayout { header: Kirigami.AbstractApplicationHeader {
width: parent.width topPadding: Kirigami.Units.smallSpacing / 2 // HACK: not dividing by two makes the header to big and not adding the spacing make it to small
DBusProperty { bottomPadding: Kirigami.Units.smallSpacing
id: announcedNameProperty leftPadding: Kirigami.Units.smallSpacing
object: DaemonDbusInterface rightPadding: Kirigami.Units.smallSpacing
read: "announcedName" contentItem: RowLayout {
defaultValue: "" anchors.fill: parent
} spacing: Kirigami.Units.smallSpacing
TextField { DBusProperty {
id: nameField id: announcedNameProperty
visible: false object: DaemonDbusInterface
Layout.fillWidth: true read: "announcedName"
Layout.leftMargin: Kirigami.Units.smallSpacing defaultValue: ""
text: announcedNameProperty.value
onAccepted: {
DaemonDbusInterface.setAnnouncedName(text)
text = Qt.binding(function() {return announcedNameProperty.value})
} }
}
Label { TextField {
text: announcedNameProperty.value id: nameField
visible: !nameField.visible visible: false
Layout.fillWidth: true Layout.fillWidth: true
elide: Qt.ElideRight text: announcedNameProperty.value
font.pointSize: 18 onAccepted: {
Layout.leftMargin: Kirigami.Units.smallSpacing DaemonDbusInterface.setAnnouncedName(text)
} text = Qt.binding(function() {return announcedNameProperty.value})
}
}
Kirigami.Heading {
level: 2
text: announcedNameProperty.value
Layout.fillWidth: true
visible: !nameField.visible
elide: Qt.ElideRight
font.pointSize: 18
}
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()
}
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment