Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Elisa
Commits
2a64ff02
Commit
2a64ff02
authored
Jun 03, 2021
by
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
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/qml/HeaderBar.qml
View file @
2a64ff02
...
...
@@ -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
...
...
src/qml/SimplePlayListView.qml
View file @
2a64ff02
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment