Warning, /education/marble/src/apps/marble-maps/PlacemarkDialog.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2015 Dennis Nienhüser <nienhueser@kde.org>
0004 //
0005
0006 import QtQuick 2.3
0007 import QtQuick.Window 2.2
0008 import QtQuick.Controls 2.0
0009 import QtQuick.Layouts 1.3
0010 import QtQuick.Dialogs 1.2
0011
0012 import org.kde.kirigami 2.0 as Kirigami
0013
0014 import org.kde.marble 0.20
0015
0016 Item {
0017 id: root
0018
0019 property var placemark: null
0020 property variant map
0021 property alias showOsmTags: tagsView.visible
0022 property bool showAccessibility: false
0023
0024 height: placemark === null ? 0 : Screen.pixelDensity * 4 +infoLayout.height
0025
0026
0027 SystemPalette {
0028 id: palette
0029 colorGroup: SystemPalette.Active
0030 }
0031
0032 Rectangle {
0033 anchors.fill: parent
0034 color: palette.base
0035 }
0036
0037 Bookmarks {
0038 id: bookmarks
0039 }
0040
0041 onMapChanged: bookmarks.map = root.map
0042
0043
0044 Column {
0045 id: infoLayout
0046 anchors {
0047 top: parent.top
0048 left: parent.left
0049 right: parent.right
0050 margins: Screen.pixelDensity * 2
0051 }
0052
0053 IconText {
0054 id: name
0055 width: parent.width
0056 visible: text.length > 0
0057 text: placemark === null ? "" : placemark.name
0058 maximumLineCount: 2
0059 font.pointSize: 20
0060 }
0061
0062 IconText {
0063 width: parent.width
0064 visible: text.length > 0
0065 text: placemark === null ? "" : placemark.description
0066 }
0067
0068 IconText {
0069 width: parent.width
0070 visible: text.length > 0
0071 text: placemark === null ? "" : placemark.address
0072 maximumLineCount: 4
0073 }
0074
0075 IconText {
0076 width: parent.width
0077 visible: routesItem.count > 0
0078 text: "<a href=\"#\">Part of " + routesItem.count + " routes</a>"
0079 maximumLineCount: 4
0080 linkColor: palette.text
0081 onLinkActivated: routesDialog.open()
0082 }
0083
0084 IconText {
0085 width: parent.width
0086 visible: url.length > 0
0087 property string url: placemark === null ? "" : placemark.website
0088 text: "<a href=\"" + url + "\">" + url + "</a>"
0089 icon: "qrc:/material/browser.svg"
0090 maximumLineCount: 4
0091 onLinkActivated: Qt.openUrlExternally(link)
0092 }
0093
0094 IconText {
0095 width: parent.width
0096 visible: phone.length > 0
0097 property string phone: placemark === null ? "" : placemark.phone
0098 text: "<a href=\"tel:" + phone + "\">" + phone + "</a>"
0099 icon: "qrc:/material/phone.svg"
0100 maximumLineCount: 1
0101 onLinkActivated: Qt.openUrlExternally(link)
0102 }
0103
0104 IconText {
0105 width: parent.width
0106 visible: url.length > 0
0107 property string url: placemark === null ? "" : placemark.wikipedia
0108 text: "<a href=\"" + url + "\">Wikipedia</a>"
0109 icon: "qrc:/material/browser.svg"
0110 maximumLineCount: 4
0111 onLinkActivated: Qt.openUrlExternally(link)
0112 }
0113
0114 IconText {
0115 width: parent.width
0116 visible: text.length > 0
0117 text: placemark === null ? "" : placemark.openingHours
0118 icon: "qrc:/material/access_time.svg"
0119 }
0120
0121 IconText {
0122 width: parent.width
0123 visible: root.showAccessibility && text.length > 0
0124 text: placemark === null ? "" : placemark.wheelchairInfo
0125 icon: "qrc:/material/wheelchair.svg"
0126 }
0127
0128 IconText {
0129 width: parent.width
0130 visible: text.length > 0
0131 text: placemark === null ? "" : placemark.wifiAvailable
0132 icon: "qrc:/material/wlan-available.svg"
0133 }
0134
0135 IconText {
0136 width: parent.width
0137 visible: text.length > 0
0138 text: placemark === null ? "" : "<a href=\"#\"#>" + placemark.coordinates + "</a>"
0139 icon: "qrc:/material/place.svg"
0140 linkColor: palette.text
0141 onLinkActivated: marbleMaps.centerOnCoordinates(placemark.longitude, placemark.latitude)
0142 }
0143
0144 ListView {
0145 id: tagsView
0146 visible: false
0147 width: parent.width
0148 height: Math.min(contentHeight, Screen.pixelDensity * 24)
0149 clip: true
0150 model: placemark ? placemark.tags : undefined
0151 delegate: IconText {
0152 width: tagsView.width;
0153 icon: "qrc:/material/label.svg"
0154 text: modelData
0155 }
0156
0157 ScrollBar.vertical: ScrollBar {}
0158 }
0159 }
0160
0161 Kirigami.OverlaySheet {
0162 id: routesDialog
0163 ColumnLayout {
0164 property int implicitWidth: root.width
0165 id: columnLayout
0166 Label{
0167 Layout.fillWidth: true
0168 text: qsTr("<h2>Routes</h2>")
0169
0170 }
0171 RoutesItem {
0172 id: routesItem
0173 Layout.fillWidth: true
0174 model: placemark === null ? undefined : placemark.routeRelationModel
0175 onHighlightChanged: map.highlightRouteRelation(oid, enabled)
0176 }
0177
0178 }
0179 }
0180 }