Laying out main page and adding songlistmodel
This commit is contained in:
parent
f2a10ebfcc
commit
3bd74d1ca6
24 changed files with 816 additions and 454 deletions
47
src/qml/presenter/Library.qml
Normal file
47
src/qml/presenter/Library.qml
Normal file
|
@ -0,0 +1,47 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Dialogs 1.0
|
||||
import QtQuick.Controls 2.0 as Controls
|
||||
import QtQuick.Layouts 1.2
|
||||
import org.kde.kirigami 2.13 as Kirigami
|
||||
import "./" as Presenter
|
||||
|
||||
Item {
|
||||
id: root
|
||||
Presenter.PanelItem {
|
||||
anchors.fill: parent
|
||||
title: "Songs"
|
||||
|
||||
ListView {
|
||||
anchors.fill: parent
|
||||
id: libraryListView
|
||||
model: _songListModel
|
||||
delegate: itemDelegate
|
||||
|
||||
Component {
|
||||
id: itemDelegate
|
||||
Kirigami.BasicListItem {
|
||||
width: ListView.view.width
|
||||
height:40
|
||||
label: title
|
||||
subtitle: author
|
||||
hoverEnabled: true
|
||||
onClicked: ListView.view.currentIndex = index
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Kirigami.WheelHandler {
|
||||
id: wheelHandler
|
||||
target: libraryListView
|
||||
filterMouseEvents: true
|
||||
keyNavigationEnabled: true
|
||||
}
|
||||
|
||||
Controls.ScrollBar.vertical: Controls.ScrollBar {
|
||||
anchors.right: libraryListView.right
|
||||
anchors.leftMargin: 10
|
||||
active: hovered || pressed
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue