From b5153b00b12bb286ba9433a5c4eea1c15144a230 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Mon, 10 Aug 2015 12:42:17 +0200 Subject: [PATCH] Show a label when no posts are found --- src/qml/danbooruimageview.qml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/qml/danbooruimageview.qml b/src/qml/danbooruimageview.qml index 216d81a..1d32e36 100644 --- a/src/qml/danbooruimageview.qml +++ b/src/qml/danbooruimageview.qml @@ -48,11 +48,17 @@ Rectangle { } onDownloadFinished: { + grid.opacity = 1 runningIndicator.running = false + + if (danbooruModel.rowCount() == 0) { + warnLabel.visible = true + } } onDownloadStarted: { + warnLabel.visible = false grid.opacity = 0.5 runningIndicator.running = true } @@ -67,6 +73,20 @@ Rectangle { running: false } + Label { + id: warnLabel + z: 1 + width: grid.cellWidth / 2 + height: grid.cellHeight / 2 + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + visible: false + text: "No posts found." + color: black + + + } + Component { id: highlight Rectangle {