Commit 46204a5e authored by Zren (Chris Holland)'s avatar Zren (Chris Holland)
Browse files

[weather] Fix weather Notices tab not showing

The code currently has a bug that will only show the Notices tab if
there's both a "warning" AND a "watch".

This patch also hides the empty Warnings/Watches heading.

Differential Revision: https://phabricator.kde.org/D18936
parent 556106bd
...@@ -21,17 +21,19 @@ Column { ...@@ -21,17 +21,19 @@ Column {
id: root id: root
property var model property var model
readonly property bool hasContent: model && model.length > 0 && model[0].length > 0 && model[1].length > 0 readonly property bool hasContent: model && model.length > 0 && (model[0].length > 0 || model[1].length > 0)
spacing: units.largeSpacing spacing: units.largeSpacing
Notice { Notice {
title: i18nc("weather warnings", "Warnings Issued:") title: i18nc("weather warnings", "Warnings Issued:")
model: root.model[0] model: root.model[0]
visible: model.length > 0
} }
Notice { Notice {
title: i18nc("weather watches" ,"Watches Issued:") title: i18nc("weather watches" ,"Watches Issued:")
model: root.model[1] model: root.model[1]
visible: model.length > 0
} }
} }
Markdown is supported
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