[wallpapers/image] Add placeholder labels when wallpaper lists are empty

Summary:
Right now, when there are no configured wallpaper slideshow paths or wallpapers in the
slideshow, the list and grid (respectively) are just empty. This patch adds some
placeholder labels to let the user know that it's not broken, just like we do in the
Thunderbolt KCM.

See one `FIXME:` in the code that I could use a hand with.

Test Plan: {F7870947}

Reviewers: #vdg, #plasma, mart

Reviewed By: #vdg, #plasma, mart

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26528
wilder-5.18
Nate Graham 6 years ago
parent 02c89d7494
commit b79f9967a5
  1. 26
      wallpapers/image/imagepackage/contents/ui/config.qml

@ -285,6 +285,18 @@ ColumnLayout {
width: slidePathsView.width
height: paintedHeight;
}
Kirigami.Heading {
anchors.fill: parent
anchors.margins: Kirigami.Units.largeSpacing
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
visible: slidePathsView.count === 0
level: 2
text: i18n("There are no wallpaper locations configured")
opacity: 0.3
}
}
}
Loader {
@ -343,6 +355,20 @@ ColumnLayout {
view.delegate: WallpaperDelegate {
color: cfg_Color
}
Kirigami.Heading {
anchors.fill: parent
anchors.margins: Kirigami.Units.largeSpacing
// FIXME: this is needed to vertically center it in the grid for some reason
anchors.topMargin: wallpapersGrid.height
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
visible: wallpapersGrid.view.count === 0
level: 2
text: i18n("There are no wallpapers in this slideshow")
opacity: 0.3
}
}
}

Loading…
Cancel
Save