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
c354cea3
Commit
c354cea3
authored
Jul 15, 2020
by
Nate Graham
Browse files
Add Placeholder messages to main views when empty
parent
11004abe
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/qml/ContextView.qml
View file @
c354cea3
...
...
@@ -11,7 +11,7 @@ import QtQuick.Controls 2.2
import
QtQml
.
Models
2.2
import
QtQuick
.
Layouts
1.2
import
QtGraphicalEffects
1.0
import
org
.
kde
.
kirigami
2.
5
as
Kirigami
import
org
.
kde
.
kirigami
2.
12
as
Kirigami
import
org
.
kde
.
elisa
1.0
FocusScope
{
...
...
@@ -25,6 +25,11 @@ FocusScope {
property
url
albumArtUrl
:
''
property
url
fileUrl
:
''
readonly
property
bool
nothingPlaying
:
albumName
.
length
===
0
&&
artistName
.
length
===
0
&&
albumArtUrl
.
toString
.
length
===
0
&&
fileUrl
.
toString
.
length
===
0
TrackContextMetaDataModel
{
id
:
metaDataModel
...
...
@@ -82,6 +87,8 @@ FocusScope {
id
:
albumArtBackground
anchors.fill
:
parent
visible
:
!
topItem
.
nothingPlaying
source
:
albumArtUrl
.
toString
()
===
''
?
Qt
.
resolvedUrl
(
elisaTheme
.
defaultAlbumImage
)
:
albumArtUrl
sourceSize.width
:
topItem
.
width
...
...
@@ -106,6 +113,8 @@ FocusScope {
anchors.fill
:
parent
clip
:
true
visible
:
!
topItem
.
nothingPlaying
contentWidth
:
content
.
width
contentHeight
:
content
.
height
...
...
@@ -206,10 +215,19 @@ FocusScope {
}
}
}
// "Nothing Playing" message
Kirigami.PlaceholderMessage
{
anchors.centerIn
:
parent
width
:
parent
.
width
-
(
Kirigami
.
Units
.
largeSpacing
*
4
)
visible
:
topItem
.
nothingPlaying
text
:
i18n
(
"
Nothing playing
"
)
}
}
// Footer with file path label
HeaderFooterToolbar
{
visible
:
!
topItem
.
nothingPlaying
type
:
"
footer
"
contentLayoutSpacing
:
Kirigami
.
Units
.
largeSpacing
contentItems
:
[
...
...
src/qml/GridBrowserView.qml
View file @
c354cea3
...
...
@@ -10,7 +10,7 @@ import QtQuick.Window 2.2
import
QtQml
.
Models
2.1
import
QtQuick
.
Layouts
1.2
import
QtGraphicalEffects
1.0
import
org
.
kde
.
kirigami
2.
5
as
Kirigami
import
org
.
kde
.
kirigami
2.
12
as
Kirigami
import
org
.
kde
.
elisa
1.0
FocusScope
{
...
...
@@ -180,6 +180,13 @@ FocusScope {
anchors.fill
:
contentDirectoryView
}
Kirigami.PlaceholderMessage
{
anchors.centerIn
:
parent
width
:
parent
.
width
-
(
Kirigami
.
Units
.
largeSpacing
*
4
)
visible
:
contentDirectoryView
.
count
===
0
text
:
i18nc
(
"
e.g. 'no artists found' or 'no albums found'
"
,
"
No %1 found
"
,
mainTitle
)
}
cellWidth
:
Math
.
floor
(
availableWidth
/
Math
.
max
(
Math
.
floor
(
availableWidth
/
elisaTheme
.
gridDelegateSize
),
2
))
cellHeight
:
elisaTheme
.
gridDelegateSize
+
Kirigami
.
Units
.
gridUnit
*
2
+
Kirigami
.
Units
.
largeSpacing
}
...
...
src/qml/ListBrowserView.qml
View file @
c354cea3
...
...
@@ -10,7 +10,7 @@ import QtQuick.Window 2.2
import
QtQml
.
Models
2.2
import
QtQuick
.
Layouts
1.2
import
QtGraphicalEffects
1.0
import
org
.
kde
.
kirigami
2.12
as
Kirigami
import
org
.
kde
.
elisa
1.0
FocusScope
{
...
...
@@ -153,6 +153,13 @@ FocusScope {
anchors.fill
:
contentDirectoryView
}
Kirigami.PlaceholderMessage
{
anchors.centerIn
:
parent
width
:
parent
.
width
-
(
Kirigami
.
Units
.
largeSpacing
*
4
)
visible
:
contentDirectoryView
.
count
===
0
text
:
i18nc
(
"
e.g. 'no artists found' or 'no albums found'
"
,
"
No %1 found
"
,
mainTitle
)
}
onCountChanged
:
if
(
count
===
0
)
{
currentIndex
=
-
1
;
}
...
...
Write
Preview
Supports
Markdown
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