Warning, /pim/itinerary/src/app/LocationPicker.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 import QtQuick
0008 import QtQuick.Layouts
0009 import QtQuick.Controls as QQC2
0010 import QtLocation as QtLocation
0011 import QtPositioning
0012 import org.kde.kirigami as Kirigami
0013 import org.kde.kirigamiaddons.components
0014 import org.kde.itinerary
0015 
0016 Kirigami.Page {
0017     id: root
0018     property variant coordinate: QtPositioning.coordinate(0, 0)
0019 
0020     topPadding: 0
0021     bottomPadding: 0
0022     leftPadding: 0
0023     rightPadding: 0
0024 
0025     // prevent swipe to the right changing pages, we want to pan the map instead
0026     Kirigami.ColumnView.preventStealing: true
0027 
0028     MapView {
0029         id: map
0030         anchors.fill: parent
0031         center: root.coordinate
0032         zoomLevel: root.coordinate.isValid ? 15 : 8
0033 
0034         QtLocation.MapQuickItem {
0035             coordinate: map.center
0036             anchorPoint { x: icon.width / 2; y: icon.height / 2 }
0037             sourceItem: Kirigami.Icon {
0038                 id: icon
0039                 source: "crosshairs"
0040                 width: height
0041                 height: Kirigami.Units.iconSizes.large
0042                 color: Kirigami.Theme.negativeTextColor
0043             }
0044         }
0045     }
0046 
0047     FloatingButton {
0048         anchors {
0049             right: parent.right
0050             rightMargin: Kirigami.Units.largeSpacing + (root.contentItem.QQC2.ScrollBar && root.contentItem.QQC2.ScrollBar.vertical ? root.contentItem.QQC2.ScrollBar.vertical.width : 0)
0051             bottom: parent.bottom
0052             bottomMargin: Kirigami.Units.largeSpacing
0053         }
0054         action: Kirigami.Action {
0055             icon.name: "crosshairs"
0056             text: i18n("Pick Location")
0057             onTriggered: {
0058                 coordinate = map.center;
0059                 applicationWindow().pageStack.goBack();
0060             }
0061         }
0062     }
0063 
0064     footer: null
0065 }