making header of list above the list as it flows upward

This commit is contained in:
Chris Cochrun 2022-10-23 06:37:36 -05:00
parent e60fcb8f56
commit 64e3978853

View file

@ -110,37 +110,44 @@ Item {
} }
header: Component { header: Component {
Kirigami.ActionToolBar { Rectangle {
id: songLibraryHeader
z: 2
height: 40 height: 40
width: parent.width width: parent.width
display: Controls.Button.IconOnly color: Kirigami.Theme.backgroundColor
visible: selectedLibrary == "songs" Kirigami.ActionToolBar {
actions: [ height: parent.height
Kirigami.Action { width: parent.width
icon.name: "document-new" display: Controls.Button.IconOnly
text: "New Song" visible: selectedLibrary == "songs"
tooltip: "Add a new song" actions: [
onTriggered: songLibraryList.newSong() Kirigami.Action {
/* visible: selectedLibrary == "songs" */ icon.name: "document-new"
}, text: "New Song"
tooltip: "Add a new song"
onTriggered: songLibraryList.newSong()
/* visible: selectedLibrary == "songs" */
},
Kirigami.Action { Kirigami.Action {
displayComponent: Component { displayComponent: Component {
Kirigami.SearchField { Kirigami.SearchField {
id: searchField id: searchField
height: parent.height height: parent.height
width: parent.width - 40 width: parent.width - 40
onAccepted: showPassiveNotification(searchField.text, 3000) onAccepted: showPassiveNotification(searchField.text, 3000)
}
} }
/* visible: selectedLibrary == "songs" */
} }
/* visible: selectedLibrary == "songs" */
}
] ]
Behavior on height { Behavior on height {
NumberAnimation { NumberAnimation {
easing.type: Easing.OutCubic easing.type: Easing.OutCubic
duration: 300 duration: 300
}
} }
} }
} }