From 7f067b698ea6ad591039ee84ca9aec149bfff924 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Sat, 17 Jun 2023 14:43:18 +0200 Subject: [PATCH] Unify map markers on the full screen and room maps as well --- src/qml/Component/FullScreenMap.qml | 24 +++++++++---------- src/qml/Component/LocationPage.qml | 18 ++------------ .../Component/Timeline/LocationDelegate.qml | 3 +-- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/src/qml/Component/FullScreenMap.qml b/src/qml/Component/FullScreenMap.qml index eccfb705d..3831ca27a 100644 --- a/src/qml/Component/FullScreenMap.qml +++ b/src/qml/Component/FullScreenMap.qml @@ -11,7 +11,10 @@ import org.kde.kirigami 2.15 as Kirigami ApplicationWindow { id: root - required property var content + required property real latitude + required property real longitude + required property string asset + required property var author flags: Qt.FramelessWindowHint | Qt.WA_TranslucentBackground visibility: Qt.WindowFullScreen @@ -32,20 +35,15 @@ ApplicationWindow { Map { id: map anchors.fill: parent - property string latlong: root.content.geo_uri.split(':')[1] - property string latitude: latlong.split(',')[0] - property string longitude: latlong.split(',')[1] - center: QtPositioning.coordinate(latitude, longitude) + center: QtPositioning.coordinate(root.latitude, root.longitude) zoomLevel: 15 plugin: OsmLocationPlugin.plugin - MapCircle { - radius: 1500 / map.zoomLevel - color: Kirigami.Theme.highlightColor - border.color: Kirigami.Theme.linkColor - border.width: Kirigami.Units.devicePixelRatio * 2 - smooth: true - opacity: 0.25 - center: QtPositioning.coordinate(map.latitude, map.longitude) + LocationMapItem { + latitude: root.latitude + longitude: root.longitude + asset: root.asset + author: root.author + isLive: true } onCopyrightLinkActivated: { Qt.openUrlExternally(link) diff --git a/src/qml/Component/LocationPage.qml b/src/qml/Component/LocationPage.qml index 65f45d064..e5724cdd2 100644 --- a/src/qml/Component/LocationPage.qml +++ b/src/qml/Component/LocationPage.qml @@ -27,22 +27,8 @@ Kirigami.Page { model: LocationsModel { room: locationsPage.room } - delegate: MapQuickItem { - id: point - - required property var longitude - required property var latitude - required property string text - anchorPoint.x: icon.width / 2 - anchorPoint.y: icon.height / 2 - coordinate: QtPositioning.coordinate(point.latitude, point.longitude) - autoFadeIn: false - sourceItem: Kirigami.Icon { - id: icon - width: height - height: Kirigami.Units.iconSizes.medium - source: "flag-blue" - } + delegate: LocationMapItem { + isLive: true } } } diff --git a/src/qml/Component/Timeline/LocationDelegate.qml b/src/qml/Component/Timeline/LocationDelegate.qml index d908a51c4..1d3ff6c2f 100644 --- a/src/qml/Component/Timeline/LocationDelegate.qml +++ b/src/qml/Component/Timeline/LocationDelegate.qml @@ -36,7 +36,6 @@ TimelineContainer { * a user's location. */ required property string asset - required property var content ColumnLayout { Layout.maximumWidth: root.contentMaxWidth @@ -63,7 +62,7 @@ TimelineContainer { TapHandler { acceptedButtons: Qt.LeftButton onTapped: { - let map = fullScreenMap.createObject(parent, {content: root.content}); + let map = fullScreenMap.createObject(parent, {latitude: root.latitude, longitude: root.longitude, asset: root.asset, author: root.author}); map.open() } onLongPressed: openMessageContext("")