Commit 2a64ff02 authored by Tranter Madi's avatar Tranter Madi 🌧
Browse files

Make partyMode list scroll to the playing track

parent 60c0e156
Pipeline #64767 passed with stage
in 9 minutes and 2 seconds
......@@ -181,8 +181,6 @@ FocusScope {
Item {
id: images
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.fillWidth: true
Layout.fillHeight: true
property double imageSize: (smallerDimension * 0.9 < (portrait?
gridLayoutContent.height/3:
gridLayoutContent.width/2
......@@ -193,9 +191,7 @@ FocusScope {
gridLayoutContent.width/2
Layout.preferredHeight: imageSize
Layout.maximumHeight: imageSize
Layout.preferredWidth: imageSize
Layout.maximumWidth: imageSize
ImageWithFallback {
......@@ -250,16 +246,14 @@ FocusScope {
Layout.fillHeight: true
Layout.maximumHeight: (headerBar.height - playControlItem.height - 8 * Kirigami.Units.largeSpacing) < gridLayoutContent.height ? (headerBar.height - playControlItem.height - 8 * Kirigami.Units.largeSpacing): gridLayoutContent.height
Layout.maximumWidth: gridLayoutContent.width
LabelWithToolTip {
id: mainLabel
text: title
wrapMode: Text.Wrap
Layout.alignment: (portrait? Qt.AlignHCenter: Qt.AlignLeft) | Qt.AlignTop
Layout.maximumWidth: gridLayoutContent.width
Layout.fillWidth: true
horizontalAlignment: portrait? Text.AlignHCenter : Text.AlignLeft
elide: Text.ElideRight
level: 1
font.bold: true
......@@ -277,11 +271,10 @@ FocusScope {
LabelWithToolTip {
id: authorLabel
text: artist
wrapMode: Text.Wrap
Layout.alignment: (portrait? Qt.AlignHCenter: Qt.AlignLeft) | Qt.AlignTop
Layout.maximumWidth: gridLayoutContent.width
Layout.fillWidth: true
horizontalAlignment: portrait? Text.AlignHCenter : Text.AlignLeft
elide: Text.ElideRight
level: 3
MouseArea {
......@@ -298,11 +291,10 @@ FocusScope {
LabelWithToolTip {
id: albumLabel
text: album
wrapMode: Text.Wrap
Layout.alignment: (portrait? Qt.AlignHCenter: Qt.AlignLeft) | Qt.AlignTop
Layout.maximumWidth: gridLayoutContent.width
Layout.fillWidth: true
horizontalAlignment: portrait? Text.AlignHCenter : Text.AlignLeft
elide: Text.ElideRight
level: 3
MouseArea {
......@@ -332,7 +324,7 @@ FocusScope {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignRight | Qt.AlignTop
Layout.maximumWidth: gridLayoutContent.width
Layout.topMargin: Kirigami.Units.largeSpacing
sourceComponent: SimplePlayListView {
anchors.fill: parent
......
......@@ -24,11 +24,32 @@ ScrollView {
ListView {
id: playListView
readonly property int nextIndex: {
var playingIndex = ElisaApplication.mediaPlayListProxyModel.currentTrackRow
if (playingIndex > 0 && playingIndex < playListView.count - 1) {
return playingIndex + 1
} else {
return playingIndex
}
}
clip: true
focus: true
activeFocusOnTab: true
keyNavigationEnabled: true
// position the view at the playing index
Component.onCompleted: currentIndex = nextIndex
Connections {
target: ElisaApplication.mediaPlayListProxyModel
function onCurrentTrackRowChanged() {
playListView.currentIndex = playListView.nextIndex
}
}
highlightMoveDuration: Kirigami.Units.veryLongDuration
highlightMoveVelocity: -1
section.property: 'albumSection'
section.criteria: ViewSection.FullString
section.labelPositioning: ViewSection.InlineLabels
......
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