Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Nate Graham
Elisa
Commits
ff598313
Commit
ff598313
authored
Aug 26, 2020
by
Nate Graham
🔩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add appropriate side margins for content in Now Playing view
BUG: 425834 FIXED-IN: 20.12.0
parent
579bd584
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
66 deletions
+81
-66
src/qml/ContextView.qml
src/qml/ContextView.qml
+81
-66
No files found.
src/qml/ContextView.qml
View file @
ff598313
...
...
@@ -118,100 +118,115 @@ FocusScope {
contentWidth
:
content
.
width
contentHeight
:
content
.
height
// Title + metadata + lyrics
ColumnLayout
{
id
:
content
// This Item holds only the content layout so we can center the
// ColumnLayout within it to provide appropriate margins. We
// can't do this if the ColumnLayout is directly inside the
// ScrollView
Item
{
width
:
scrollView
.
width
-
scrollView
.
ScrollBar
.
vertical
.
width
//
Song title
LabelWithToolTip
{
id
:
titleLabel
//
Layout holding the Title + metadata + lyrics labels
ColumnLayout
{
id
:
content
level
:
1
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
anchors.leftMargin
:
Kirigami
.
Units
.
largeSpacing
*
2
anchors.right
:
parent
.
right
anchors.rightMargin
:
Kirigami
.
Units
.
largeSpacing
*
2
// No bottom anchors so it can grow
horizontalAlignment
:
Label
.
AlignHCenter
// Song title
LabelWithToolTip
{
id
:
titleLabel
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignTop
level
:
1
Layout.topMargin
:
elisaTheme
.
layoutVerticalMargin
}
horizontalAlignment
:
Label
.
AlignHCenter
Labe
lWith
ToolTip
{
id
:
subtitleLabel
Layout.fil
lWi
d
th
:
true
Layout.alignment
:
Qt
.
AlignTop
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
)
}
Layout.topMargin
:
elisaTheme
.
layoutVerticalMargin
}
level
:
3
opacity
:
0.6
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
)
}
}
horizontalAlignment
:
Label
.
AlignHCenter
level
:
3
opacity
:
0.6
visible
:
artistName
!==
''
&&
albumName
!==
''
horizontalAlignment
:
Label
.
AlignHCenter
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignTop
}
visible
:
artistName
!==
''
&&
albumName
!==
''
// 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.bottomMargin
:
Kirigami
.
Units
.
largeSpacing
}
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignTop
}
// Metadata
ColumnLayout
{
id
:
allMetaData
// 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.bottomMargin
:
Kirigami
.
Units
.
largeSpacing
}
// Metadata
ColumnLayout
{
id
:
allMetaData
spacing
:
0
Layout.fillWidth
:
true
spacing
:
0
Layout.fillWidth
:
true
//Layout.leftMargin:Kirigami.Units.largeSpacing
//Layout.rightMargin:Kirigami.Units.largeSpacing
Repeater
{
id
:
trackData
Repeater
{
id
:
trackData
model
:
metaDataModel
model
:
metaDataModel
delegate
:
MetaDataDelegate
{
Layout.fillWidth
:
true
delegate
:
MetaDataDelegate
{
Layout.fillWidth
:
true
}
}
}
}
// Horizontal line separating metadata from lyrics
Kirigami.Separator
{
Layout.fillWidth
:
true
Layout.leftMargin
:
Kirigami
.
Units
.
largeSpacing
*
5
Layout.rightMargin
:
Kirigami
.
Units
.
largeSpacing
*
5
Layout.topMargin
:
Kirigami
.
Units
.
largeSpacing
Layout.bottomMargin
:
Kirigami
.
Units
.
largeSpacing
// Horizontal line separating metadata from lyrics
Kirigami.Separator
{
Layout.fillWidth
:
true
Layout.leftMargin
:
Kirigami
.
Units
.
largeSpacing
*
5
Layout.rightMargin
:
Kirigami
.
Units
.
largeSpacing
*
5
Layout.topMargin
:
Kirigami
.
Units
.
largeSpacing
Layout.bottomMargin
:
Kirigami
.
Units
.
largeSpacing
visible
:
metaDataModel
.
lyrics
!==
""
}
visible
:
metaDataModel
.
lyrics
!==
""
}
// Lyrics
Label
{
text
:
metaDataModel
.
lyrics
// Lyrics
Label
{
text
:
metaDataModel
.
lyrics
wrapMode
:
Text
.
WordWrap
wrapMode
:
Text
.
WordWrap
horizontalAlignment
:
Label
.
AlignHCenter
horizontalAlignment
:
Label
.
AlignHCenter
Layout.fillWidth
:
true
Layout.bottomMargin
:
Kirigami
.
Units
.
smallSpacing
visible
:
metaDataModel
.
lyrics
!==
""
Layout.fillWidth
:
true
Layout.bottomMargin
:
Kirigami
.
Units
.
smallSpacing
visible
:
metaDataModel
.
lyrics
!==
""
}
}
}
}
...
...
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