From e7fe65bf57095e3ddc9db9f508fc17c54cf93a43 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 8 Jun 2024 09:38:49 -0400 Subject: [PATCH] Don't show the map if there's no locations available It's hard to the read the text when there's a beige map behind it, and unnecessary anyway. (cherry picked from commit f278cc0c86e56445e0309281672cbb5ba948b21c) --- src/qml/LocationsPage.qml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/qml/LocationsPage.qml b/src/qml/LocationsPage.qml index d0386e9f6..a4c73d5cf 100644 --- a/src/qml/LocationsPage.qml +++ b/src/qml/LocationsPage.qml @@ -21,6 +21,7 @@ Kirigami.Page { id: mapView anchors.fill: parent map.plugin: OsmLocationPlugin.plugin + visible: mapView.map.mapItems.length !== 0 map.center: { let c = LocationHelper.center(LocationHelper.unite(locationsModel.boundingBox, liveLocationsModel.boundingBox)); @@ -52,11 +53,6 @@ Kirigami.Page { delegate: LocationMapItem {} } - Kirigami.PlaceholderMessage { - text: i18n("There are no locations shared in this room.") - visible: mapView.map.mapItems.length === 0 - anchors.centerIn: parent - } Connections { target: mapView.map function onCopyrightLinkActivated() { @@ -64,4 +60,10 @@ Kirigami.Page { } } } + + Kirigami.PlaceholderMessage { + text: i18n("There are no locations shared in this room.") + visible: mapView.map.mapItems.length === 0 + anchors.centerIn: parent + } }