Commit c8ecdec0 authored by Nate Graham's avatar Nate Graham
Browse files

Put PlaceholderMessage instances in Loaders

Saves a bit of resources when they're not shown, which is most of the
time.
parent f00399c5
......@@ -291,24 +291,37 @@ Kirigami.Page {
width: parent.width
}
Kirigami.PlaceholderMessage {
Loader {
id: lyricPlaceholder
visible: !lyricLabel.visible
text: i18n("No lyrics found")
icon.name: "view-media-lyrics"
anchors.centerIn: parent
width: parent.width
active: !lyricLabel.visible
visible: active && status === Loader.Ready
sourceComponent: Kirigami.PlaceholderMessage {
text: i18n("No lyrics found")
icon.name: "view-media-lyrics"
}
}
}
}
}
// "Nothing Playing" message
Kirigami.PlaceholderMessage {
Loader {
anchors.centerIn: parent
width: parent.width - (Kirigami.Units.largeSpacing * 4)
visible: topItem.nothingPlaying
text: i18n("Nothing playing")
icon.name: "view-media-track"
active: topItem.nothingPlaying
visible: active && status === Loader.Ready
sourceComponent: Kirigami.PlaceholderMessage {
anchors.centerIn: parent
text: i18n("Nothing playing")
icon.name: "view-media-track"
}
}
}
......
......@@ -228,12 +228,18 @@ Kirigami.Page {
currentIndex = -1;
}
Kirigami.PlaceholderMessage {
Loader {
anchors.centerIn: parent
width: parent.width - (Kirigami.Units.largeSpacing * 4)
text: i18n("Playlist is empty")
explanation: i18n("Add some songs to get started. You can browse your music using the views on the left.")
visible: playListView.count === 0
active: playListView.count === 0
visible: active && status === Loader.Ready
sourceComponent: Kirigami.PlaceholderMessage {
anchors.centerIn: parent
text: i18n("Playlist is empty")
explanation: i18n("Add some songs to get started. You can browse your music using the views on the left.")
}
}
/* currently disabled animations due to display corruption
......@@ -295,16 +301,19 @@ Kirigami.Page {
}
}
Kirigami.PlaceholderMessage {
Loader {
anchors.centerIn: parent
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: Kirigami.Units.largeSpacing
width: parent.width - (Kirigami.Units.largeSpacing * 4)
visible: ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount === 0 : true
icon.name: "view-media-playlist"
text: xi18nc("@info", "Your playlist is empty.")
active: ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount === 0 : true
visible: active && status === Loader.Ready
sourceComponent: Kirigami.PlaceholderMessage {
anchors.centerIn: parent
icon.name: "view-media-playlist"
text: xi18nc("@info", "Your playlist is empty.")
}
}
delegate: Item {
......
Supports Markdown
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