Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Elisa
Commits
42e17587
Commit
42e17587
authored
Sep 03, 2020
by
stef lep
Committed by
Matthieu Gallien
Sep 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go to artist or album from context, BUG-417858
parent
69bf2260
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
31 deletions
+89
-31
src/qml/ContentView.qml
src/qml/ContentView.qml
+4
-0
src/qml/ContextView.qml
src/qml/ContextView.qml
+85
-31
No files found.
src/qml/ContentView.qml
View file @
42e17587
...
...
@@ -337,6 +337,10 @@ RowLayout {
albumName
:
ElisaApplication
.
manageHeaderBar
.
album
albumArtUrl
:
ElisaApplication
.
manageHeaderBar
.
image
fileUrl
:
ElisaApplication
.
manageHeaderBar
.
fileUrl
albumId
:
ElisaApplication
.
manageHeaderBar
.
albumId
albumArtist
:
(
ElisaApplication
.
manageHeaderBar
.
albumArtist
!==
undefined
?
ElisaApplication
.
manageHeaderBar
.
albumArtist
:
''
)
onOpenArtist
:
{
contentViewContainer
.
openArtist
(
artistName
)
}
onOpenAlbum
:
{
contentViewContainer
.
openAlbum
(
albumName
,
albumArtist
,
albumArtUrl
,
albumId
)
}
}
}
}
src/qml/ContextView.qml
View file @
42e17587
...
...
@@ -24,6 +24,11 @@ FocusScope {
property
string
artistName
:
''
property
url
albumArtUrl
:
''
property
url
fileUrl
:
''
property
int
albumId
property
string
albumArtist
:
''
signal
openArtist
()
signal
openAlbum
()
readonly
property
bool
nothingPlaying
:
albumName
.
length
===
0
&&
artistName
.
length
===
0
...
...
@@ -138,53 +143,102 @@ FocusScope {
// No bottom anchors so it can grow
// Song title
LabelWithToolTip
{
id
:
titleLabel
RowLayout
{
Layout.fillWidth
:
false
Layout.alignment
:
Qt
.
AlignHCenter
Layout.maximumWidth
:
parent
.
width
Image
{
source
:
"
image://icon/view-media-track
"
Layout.preferredWidth
:
sourceSize
.
width
Layout.preferredHeight
:
sourceSize
.
height
sourceSize
{
width
:
Kirigami
.
Units
.
iconSizes
.
smallMedium
height
:
Kirigami
.
Units
.
iconSizes
.
smallMedium
}
}
LabelWithToolTip
{
id
:
titleLabel
level
:
1
level
:
1
horizontalAlignment
:
Label
.
AlignHCenter
horizontalAlignment
:
Label
.
AlignHCenter
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignTop
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignTop
Layout.topMargin
:
elisaTheme
.
layoutVerticalMargin
Layout.topMargin
:
elisaTheme
.
layoutVerticalMargin
wrapMode
:
Text
.
Wrap
wrapMode
:
Text
.
Wrap
}
}
LabelWithToolTip
{
id
:
subtitleLabel
text
:
{
if
(
artistName
!==
''
&&
albumName
!==
''
)
{
return
i18nc
(
"
display of artist and album in context view
"
,
"
<i>by</i> <b>%1</b> <i>from</i> <b>%2</b>
"
,
artistName
,
albumName
)
}
else
if
(
artistName
===
''
&&
albumName
!==
''
)
{
return
i18nc
(
"
display of album in context view
"
,
"
<i>from</i> <b>%1</b>
"
,
albumName
)
}
else
if
(
artistName
!==
''
&&
albumName
===
''
)
{
i18nc
(
"
display of artist in context view
"
,
"
<i>by</i> <b>%1</b>
"
,
artistName
)
RowLayout
{
visible
:
artistName
!==
''
Layout.fillWidth
:
false
Layout.alignment
:
Qt
.
AlignHCenter
Layout.maximumWidth
:
parent
.
width
Image
{
source
:
"
image://icon/view-media-artist
"
visible
:
artistName
!==
''
Layout.preferredWidth
:
sourceSize
.
width
Layout.preferredHeight
:
sourceSize
.
height
sourceSize
{
width
:
Kirigami
.
Units
.
iconSizes
.
smallMedium
height
:
Kirigami
.
Units
.
iconSizes
.
smallMedium
}
}
Kirigami.LinkButton
{
text
:
artistName
!==
''
?
artistName
:
""
opacity
:
0.6
visible
:
artistName
!==
''
Layout.fillWidth
:
true
elide
:
Text
.
ElideNone
wrapMode
:
Text
.
Wrap
font.pointSize
:
Math
.
round
(
Kirigami
.
Theme
.
defaultFont
.
pointSize
*
1.20
)
font.bold
:
true
color
:
Kirigami
.
Theme
.
textColor
onClicked
:
{
openArtist
();
}
}
}
RowLayout
{
visible
:
albumName
!==
''
Layout.fillWidth
:
false
Layout.alignment
:
Qt
.
AlignHCenter
Layout.maximumWidth
:
parent
.
width
Image
{
source
:
"
image://icon/view-media-album-cover
"
visible
:
albumName
!==
''
Layout.preferredWidth
:
sourceSize
.
width
Layout.preferredHeight
:
sourceSize
.
height
sourceSize
{
width
:
Kirigami
.
Units
.
iconSizes
.
smallMedium
height
:
Kirigami
.
Units
.
iconSizes
.
smallMedium
}
}
Kirigami.LinkButton
{
text
:
albumName
!==
''
?
albumName
:
""
opacity
:
0.6
visible
:
albumName
!==
''
Layout.fillWidth
:
true
wrapMode
:
Text
.
Wrap
elide
:
Text
.
ElideNone
font.pointSize
:
Math
.
round
(
Kirigami
.
Theme
.
defaultFont
.
pointSize
*
1.20
)
font.bold
:
true
color
:
Kirigami
.
Theme
.
textColor
onClicked
:
{
openAlbum
();
}
}
level
:
3
opacity
:
0.6
horizontalAlignment
:
Label
.
AlignHCenter
visible
:
artistName
!==
''
&&
albumName
!==
''
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignTop
wrapMode
:
Text
.
Wrap
}
// Horizontal line separating title and subtitle from metadata
Kirigami.Separator
{
Layout.fillWidth
:
true
Layout.leftMargin
:
Kirigami
.
Units
.
largeSpacing
*
5
Layout.rightMargin
:
Kirigami
.
Units
.
largeSpacing
*
5
Layout.topMargin
:
Kirigami
.
Units
.
largeSpacing
Layout.rightMargin
:
Kirigami
.
Units
.
largeSpacing
*
5
Layout.bottomMargin
:
Kirigami
.
Units
.
largeSpacing
}
...
...
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