putting library header in column so that scrollbar isn't above
This commit is contained in:
parent
64e3978853
commit
2935632df5
1 changed files with 71 additions and 47 deletions
|
@ -75,47 +75,14 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView {
|
|
||||||
Layout.preferredHeight: parent.height - 200
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
id: songLibraryList
|
|
||||||
model: songsqlmodel
|
|
||||||
delegate: songDelegate
|
|
||||||
state: "selected"
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "deselected"
|
|
||||||
when: (selectedLibrary !== "songs")
|
|
||||||
PropertyChanges { target: songLibraryList
|
|
||||||
Layout.preferredHeight: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "selected"
|
|
||||||
when: (selectedLibrary == "songs")
|
|
||||||
PropertyChanges { target: songLibraryList }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
transitions: Transition {
|
|
||||||
to: "*"
|
|
||||||
NumberAnimation {
|
|
||||||
target: songLibraryList
|
|
||||||
properties: "preferredHeight"
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
duration: 300
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
header: Component {
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: songLibraryHeader
|
id: songLibraryHeader
|
||||||
z: 2
|
z: 2
|
||||||
height: 40
|
height: 40
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
|
/* width: parent.width */
|
||||||
color: Kirigami.Theme.backgroundColor
|
color: Kirigami.Theme.backgroundColor
|
||||||
|
opacity: 1
|
||||||
Kirigami.ActionToolBar {
|
Kirigami.ActionToolBar {
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -151,9 +118,40 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
headerPositioning: ListView.OverlayHeader
|
ListView {
|
||||||
|
Layout.preferredHeight: parent.height - 200
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
id: songLibraryList
|
||||||
|
model: songsqlmodel
|
||||||
|
delegate: songDelegate
|
||||||
|
state: "selected"
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "deselected"
|
||||||
|
when: (selectedLibrary !== "songs")
|
||||||
|
PropertyChanges { target: songLibraryList
|
||||||
|
Layout.preferredHeight: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "selected"
|
||||||
|
when: (selectedLibrary == "songs")
|
||||||
|
PropertyChanges { target: songLibraryList }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
transitions: Transition {
|
||||||
|
to: "*"
|
||||||
|
NumberAnimation {
|
||||||
|
target: songLibraryList
|
||||||
|
properties: "preferredHeight"
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
duration: 300
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: songDelegate
|
id: songDelegate
|
||||||
|
@ -279,7 +277,10 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.ScrollBar.vertical: Controls.ScrollBar {
|
Controls.ScrollBar.vertical: Controls.ScrollBar {
|
||||||
anchors.right: songLibraryList.right
|
/* parent: songLibraryList.parent */
|
||||||
|
/* anchors.right: songLibraryList.right */
|
||||||
|
/* anchors.top: songLibraryList.headerItem.top */
|
||||||
|
/* anchors.bottom: songLibraryList.bottom */
|
||||||
/* anchors.leftMargin: 10 */
|
/* anchors.leftMargin: 10 */
|
||||||
/* anchors.left: songLibraryList.right */
|
/* anchors.left: songLibraryList.right */
|
||||||
active: hovered || pressed
|
active: hovered || pressed
|
||||||
|
@ -701,6 +702,14 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Controls.ScrollBar.vertical: Controls.ScrollBar {
|
||||||
|
/* anchors.right: videoLibraryList.right */
|
||||||
|
/* anchors.leftMargin: 10 */
|
||||||
|
/* anchors.left: videoLibraryList.right */
|
||||||
|
active: hovered || pressed
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -903,6 +912,13 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Controls.ScrollBar.vertical: Controls.ScrollBar {
|
||||||
|
/* anchors.right: videoLibraryList.right */
|
||||||
|
/* anchors.leftMargin: 10 */
|
||||||
|
/* anchors.left: videoLibraryList.right */
|
||||||
|
active: hovered || pressed
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -960,6 +976,14 @@ Item {
|
||||||
duration: 300
|
duration: 300
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Controls.ScrollBar.vertical: Controls.ScrollBar {
|
||||||
|
/* anchors.right: videoLibraryList.right */
|
||||||
|
/* anchors.leftMargin: 10 */
|
||||||
|
/* anchors.left: videoLibraryList.right */
|
||||||
|
active: hovered || pressed
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue