diff --git a/applets/weather/package/contents/ui/NoticesView.qml b/applets/weather/package/contents/ui/NoticesView.qml --- a/applets/weather/package/contents/ui/NoticesView.qml +++ b/applets/weather/package/contents/ui/NoticesView.qml @@ -26,7 +26,7 @@ id: root property alias model: categoryRepeater.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 @@ -36,10 +36,14 @@ delegate: ColumnLayout { property var categoryData: modelData + readonly property bool categoryHasNotices: categoryData.length > 0 + visible: categoryHasNotices + Layout.alignment: Qt.AlignTop | Qt.AlignHCenter PlasmaExtras.Heading { level: 4 + Layout.alignment: Qt.AlignHCenter text: index == 0 ? i18nc("@title:column weather warnings", "Warnings Issued") : i18nc("@title:column weather watches" ,"Watches Issued") } diff --git a/applets/weather/package/contents/ui/SwitchPanel.qml b/applets/weather/package/contents/ui/SwitchPanel.qml --- a/applets/weather/package/contents/ui/SwitchPanel.qml +++ b/applets/weather/package/contents/ui/SwitchPanel.qml @@ -31,8 +31,7 @@ property alias forecastViewTitle: forecastTabButton.text readonly property bool hasDetailsContent: detailsModel && detailsModel.length > 0 - readonly property bool hasNoticesContent: noticesModel && noticesModel.length > 0 && - noticesModel[0].length > 0 && noticesModel[1].length > 0 + readonly property alias hasNoticesContent: noticesView.hasContent function removePage(page) { // fill-in for removeItem, replace for QQC >= 2.3