summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-11-15 21:00:34 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-11-15 21:00:34 (GMT)
commit06c3888c81b722634e08503aed1d6eaa0b7035c2 (patch)
treebb8541a447b4800db0414407a82f99de45d129bd
parent7164dc98cfd39387fb6c17b8a4a171bfdfb84bd5 (diff)
Center on placemark when tapping on its coordinates
-rw-r--r--src/apps/marble-maps/IconText.qml5
-rw-r--r--src/apps/marble-maps/PlacemarkDialog.qml6
2 files changed, 9 insertions, 2 deletions
diff --git a/src/apps/marble-maps/IconText.qml b/src/apps/marble-maps/IconText.qml
index c19ab59..1f8c124 100644
--- a/src/apps/marble-maps/IconText.qml
+++ b/src/apps/marble-maps/IconText.qml
@@ -21,6 +21,9 @@ Item {
property alias icon: icon.source
property alias font: text.font
property alias maximumLineCount: text.maximumLineCount
+ property alias linkColor: text.linkColor
+
+ signal linkActivated(string link)
Image {
id: icon
@@ -38,7 +41,7 @@ Item {
wrapMode: Text.WordWrap
elide: Text.ElideRight
- onLinkActivated: Qt.openUrlExternally(link)
+ onLinkActivated: root.linkActivated(link)
MouseArea {
anchors.fill: parent
diff --git a/src/apps/marble-maps/PlacemarkDialog.qml b/src/apps/marble-maps/PlacemarkDialog.qml
index 5cd1ab1..4bda254 100644
--- a/src/apps/marble-maps/PlacemarkDialog.qml
+++ b/src/apps/marble-maps/PlacemarkDialog.qml
@@ -94,6 +94,7 @@ Item {
text: "<a href=\"" + url + "\">" + url + "</a>"
icon: "qrc:/material/browser.svg"
maximumLineCount: 4
+ onLinkActivated: Qt.openUrlExternally(link)
}
IconText {
@@ -103,6 +104,7 @@ Item {
text: "<a href=\"" + url + "\">Wikipedia</a>"
icon: "qrc:/material/browser.svg"
maximumLineCount: 4
+ onLinkActivated: Qt.openUrlExternally(link)
}
IconText {
@@ -115,8 +117,10 @@ Item {
IconText {
width: parent.width
visible: text.length > 0
- text: placemark === null ? "" : placemark.coordinates
+ text: placemark === null ? "" : "<a href=\"#\"#>" + placemark.coordinates + "</a>"
icon: "qrc:/material/place.svg"
+ linkColor: palette.text
+ onLinkActivated: marbleMaps.centerOnCoordinates(placemark.longitude, placemark.latitude)
}
}