From d80a93eff83dee13963b72682fd5601853261899 Mon Sep 17 00:00:00 2001 From: Bramastyo Harimukti Date: Thu, 22 Mar 2018 17:39:11 +0100 Subject: [mapapp] Refactor the application to use the new architecture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTAUTO-883 Change-Id: I350d66179e6fe1281f075c91d4548af02f38a177 Reviewed-by: Lukáš Tinkl --- .../FavoriteDestinationButtons.qml | 82 ------ .../HeaderBackgroundMaximized.qml | 104 ------- .../HeaderBackgroundWidget.qml | 54 ---- apps/com.pelagicore.qtlocation/Main.qml | 10 +- apps/com.pelagicore.qtlocation/MapHeader.qml | 173 ----------- apps/com.pelagicore.qtlocation/MapRouting.qml | 135 --------- .../MapSearchTextField.qml | 74 ----- apps/com.pelagicore.qtlocation/MapToolButton.qml | 89 ------ apps/com.pelagicore.qtlocation/MapView.qml | 230 --------------- apps/com.pelagicore.qtlocation/Maps.qml | 323 --------------------- .../NavigationConfirm.qml | 121 -------- .../com.pelagicore.qtlocation/NavigationSearch.qml | 84 ------ apps/com.pelagicore.qtlocation/StandAlone.qml | 63 ---- .../controls/MapSearchTextField.qml | 76 +++++ .../controls/MapToolButton.qml | 89 ++++++ apps/com.pelagicore.qtlocation/helpers/Helper.qml | 42 +++ .../helpers/StandAlone.qml | 65 +++++ .../helpers/run-standalone.sh | 2 + .../panels/FavDestinationButtonsPanel.qml | 86 ++++++ .../panels/HeaderBackgroundMaximizedPanel.qml | 107 +++++++ .../panels/HeaderBackgroundWidgetPanel.qml | 56 ++++ .../panels/MapBoxPanel.qml | 230 +++++++++++++++ .../panels/MapHeaderPanel.qml | 173 +++++++++++ .../panels/NavigationConfirmPanel.qml | 123 ++++++++ .../panels/NavigationSearchPanel.qml | 86 ++++++ .../panels/SearchOverlayPanel.qml | 118 ++++++++ apps/com.pelagicore.qtlocation/run-standalone.sh | 2 - apps/com.pelagicore.qtlocation/stores/MapStore.qml | 135 +++++++++ apps/com.pelagicore.qtlocation/views/MapView.qml | 300 +++++++++++++++++++ imports/assets/translations/cs_CZ.ts | 93 +++++- imports/assets/translations/de_DE.ts | 24 +- imports/assets/translations/en_GB.ts | 53 +++- imports/assets/translations/en_US.ts | 53 +++- imports/assets/translations/ja_JP.ts | 85 +++++- imports/assets/translations/ko_KR.ts | 85 +++++- imports/assets/translations/zh_CN.ts | 85 +++++- imports/shared/utils/Style.qml | 5 - 37 files changed, 2093 insertions(+), 1622 deletions(-) delete mode 100644 apps/com.pelagicore.qtlocation/FavoriteDestinationButtons.qml delete mode 100644 apps/com.pelagicore.qtlocation/HeaderBackgroundMaximized.qml delete mode 100644 apps/com.pelagicore.qtlocation/HeaderBackgroundWidget.qml delete mode 100644 apps/com.pelagicore.qtlocation/MapHeader.qml delete mode 100644 apps/com.pelagicore.qtlocation/MapRouting.qml delete mode 100644 apps/com.pelagicore.qtlocation/MapSearchTextField.qml delete mode 100644 apps/com.pelagicore.qtlocation/MapToolButton.qml delete mode 100644 apps/com.pelagicore.qtlocation/MapView.qml delete mode 100644 apps/com.pelagicore.qtlocation/Maps.qml delete mode 100644 apps/com.pelagicore.qtlocation/NavigationConfirm.qml delete mode 100644 apps/com.pelagicore.qtlocation/NavigationSearch.qml delete mode 100644 apps/com.pelagicore.qtlocation/StandAlone.qml create mode 100644 apps/com.pelagicore.qtlocation/controls/MapSearchTextField.qml create mode 100644 apps/com.pelagicore.qtlocation/controls/MapToolButton.qml create mode 100644 apps/com.pelagicore.qtlocation/helpers/Helper.qml create mode 100644 apps/com.pelagicore.qtlocation/helpers/StandAlone.qml create mode 100755 apps/com.pelagicore.qtlocation/helpers/run-standalone.sh create mode 100644 apps/com.pelagicore.qtlocation/panels/FavDestinationButtonsPanel.qml create mode 100644 apps/com.pelagicore.qtlocation/panels/HeaderBackgroundMaximizedPanel.qml create mode 100644 apps/com.pelagicore.qtlocation/panels/HeaderBackgroundWidgetPanel.qml create mode 100644 apps/com.pelagicore.qtlocation/panels/MapBoxPanel.qml create mode 100644 apps/com.pelagicore.qtlocation/panels/MapHeaderPanel.qml create mode 100644 apps/com.pelagicore.qtlocation/panels/NavigationConfirmPanel.qml create mode 100644 apps/com.pelagicore.qtlocation/panels/NavigationSearchPanel.qml create mode 100644 apps/com.pelagicore.qtlocation/panels/SearchOverlayPanel.qml delete mode 100755 apps/com.pelagicore.qtlocation/run-standalone.sh create mode 100644 apps/com.pelagicore.qtlocation/stores/MapStore.qml create mode 100644 apps/com.pelagicore.qtlocation/views/MapView.qml diff --git a/apps/com.pelagicore.qtlocation/FavoriteDestinationButtons.qml b/apps/com.pelagicore.qtlocation/FavoriteDestinationButtons.qml deleted file mode 100644 index ebaf126d..00000000 --- a/apps/com.pelagicore.qtlocation/FavoriteDestinationButtons.qml +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Pelagicore AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 -import QtQuick.Layouts 1.3 -import QtPositioning 5.9 - -import animations 1.0 -import utils 1.0 -import com.pelagicore.styles.neptune 3.0 - -Item { - id: root - - property var homeAddressData - property var workAddressData - - property string homeRouteTime: "" - property string workRouteTime: "" - - signal showRoute(var destCoord, string description) - - RowLayout { - anchors.fill: parent - MapToolButton { - id: buttonGoHome - Layout.preferredWidth: root.width/2 - anchors.verticalCenter: parent.verticalCenter - iconSource: Style.localAsset("ic-home", NeptuneStyle.theme) - primaryText: qsTr("Home") - extendedText: homeRouteTime - //TODO: add properties to the root object to access this externally - secondaryText: "Welandergatan 29" - onClicked: root.showRoute(root.homeAddressData, secondaryText) - } - Rectangle { - width: 1 - height: parent.height - opacity: NeptuneStyle.fontOpacityDisabled - color: NeptuneStyle.primaryTextColor - } - MapToolButton { - id: buttonGoWork - Layout.preferredWidth: root.width/2 - anchors.verticalCenter: parent.verticalCenter - iconSource: Style.localAsset("ic-work", NeptuneStyle.theme) - primaryText: qsTr("Work") - extendedText: workRouteTime - //TODO: add properties to the root object to access this externally - secondaryText: "Östra Hamngatan 16" - onClicked: root.showRoute(root.workAddressData, secondaryText) - } - } -} diff --git a/apps/com.pelagicore.qtlocation/HeaderBackgroundMaximized.qml b/apps/com.pelagicore.qtlocation/HeaderBackgroundMaximized.qml deleted file mode 100644 index f0aa6921..00000000 --- a/apps/com.pelagicore.qtlocation/HeaderBackgroundMaximized.qml +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Pelagicore AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 - -import utils 1.0 -import animations 1.0 - -import com.pelagicore.styles.neptune 3.0 - -Item { - id: root - - property int destinationButtonrowHeight: 0 - property bool navigationMode: false - property bool guidanceMode: false - height: destinationButtonsPanel.visible ? destinationButtonsPanel.sourceSize.height : searchPanel.height - - BorderImage { - id: outerShadow - anchors.top: destinationButtonsPanel.top - anchors.topMargin: -40 - anchors.left: destinationButtonsPanel.left - anchors.right: destinationButtonsPanel.right - anchors.rightMargin: -Style.vspan(.5) - height: root.navigationMode && !root.guidanceMode ? sourceSize.height - root.destinationButtonrowHeight : sourceSize.height - source: Style.localAsset("panel-shadow", NeptuneStyle.theme) - border { - left: 0 - top: 101 - right: 101 - bottom: 106 - } - } - - BorderImage { - id: destinationButtonsPanel - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.rightMargin: -Style.vspan(1) - source: Style.localAsset("panel-more-contrast-background", NeptuneStyle.theme) - visible: !root.navigationMode || root.guidanceMode - border { - left: 0 - top: 20 - right: 32 - bottom: 22 - } - } - - Image { - id: innerShadow - anchors.top: searchPanel.bottom - anchors.right: searchPanel.right - anchors.left: searchPanel.left - width: searchPanel.width - source: Style.gfx2("panel-inner-shadow", NeptuneStyle.theme) - } - - BorderImage { - id: searchPanel - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.rightMargin: -Style.vspan(1) - height: root.guidanceMode ? sourceSize.height : destinationButtonsPanel.sourceSize.height - root.destinationButtonrowHeight - source: Style.localAsset("panel-background", NeptuneStyle.theme) - border { - left: 0 - top: 20 - right: 22 - bottom: 0 - } - } -} diff --git a/apps/com.pelagicore.qtlocation/HeaderBackgroundWidget.qml b/apps/com.pelagicore.qtlocation/HeaderBackgroundWidget.qml deleted file mode 100644 index 9267d8f3..00000000 --- a/apps/com.pelagicore.qtlocation/HeaderBackgroundWidget.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Pelagicore AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 - -import utils 1.0 -import animations 1.0 - -import com.pelagicore.styles.neptune 3.0 - -Item { - id: root - - height: widgetBackgroundImage.height - - Image { - id: widgetBackgroundImage - height: root.state === "Widget3Rows" ? sourceSize.height : sourceSize.height/2 - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - fillMode: Image.TileHorizontally - source: Style.localAsset("navigation-widget-overlay-top", NeptuneStyle.theme) - Behavior on height { DefaultNumberAnimation {} } - } -} diff --git a/apps/com.pelagicore.qtlocation/Main.qml b/apps/com.pelagicore.qtlocation/Main.qml index 0601f790..ea695898 100644 --- a/apps/com.pelagicore.qtlocation/Main.qml +++ b/apps/com.pelagicore.qtlocation/Main.qml @@ -36,6 +36,8 @@ import com.pelagicore.systeminfo 1.0 import com.pelagicore.qtlocation 1.0 import QtApplicationManager 1.0 +import "views" +import "stores" QtObject { id: root @@ -70,7 +72,7 @@ QtObject { } } - Maps { + MapView { id: mainMap x: state === "Maximized" && !searchViewEnabled ? mainWindow.x : mainWindow.exposedRect.x y: state === "Maximized" && !searchViewEnabled ? mainWindow.y : mainWindow.exposedRect.y @@ -79,6 +81,9 @@ QtObject { state: mainWindow.neptuneState offlineMapsEnabled: !sysinfo.online && Qt.platform.os === "linux" mapInteractive: !searchViewEnabled + store: MapStore { + currentLocationCoord: mainMap.currentLocation + } onMapReadyChanged: { if (mapReady && !mainWindow.secondaryWindowObject) { @@ -98,7 +103,7 @@ QtObject { property Component secondaryWindowComponent: Component { id: secondaryWindowComponent SecondaryWindow { - Maps { + MapView { anchors.fill: parent mapInteractive: false mapCenter: mainMap.mapCenter @@ -106,6 +111,7 @@ QtObject { mapTilt: mainMap.mapTilt mapBearing: mainMap.mapBearing offlineMapsEnabled: mainMap.offlineMapsEnabled + store: mainMap.store } } } diff --git a/apps/com.pelagicore.qtlocation/MapHeader.qml b/apps/com.pelagicore.qtlocation/MapHeader.qml deleted file mode 100644 index f5158404..00000000 --- a/apps/com.pelagicore.qtlocation/MapHeader.qml +++ /dev/null @@ -1,173 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Pelagicore AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.3 -import QtPositioning 5.9 - -import utils 1.0 -import com.pelagicore.styles.neptune 3.0 -import controls 1.0 as NeptuneControls -import animations 1.0 - -Item { - id: root - - height: offlineMapsEnabled ? 0 : headerBackgroundFullscreen.height - - property bool offlineMapsEnabled - property bool navigationMode - property bool guidanceMode - property var currentLocation - - property string destination: "" - property string routeDistance: "" - property string routeTime: "" - property string homeRouteTime: "" - property string workRouteTime: "" - - // TODO make the locations configurable and dynamic - readonly property var homeAddressData: QtPositioning.coordinate(57.706436, 12.018661) - readonly property var workAddressData: QtPositioning.coordinate(57.709545, 11.967005) - - readonly property int destinationButtonrowHeight: 150 - - signal showRoute(var destCoord, string description) - signal startNavigation() - signal stopNavigation() - signal openSearchTextInput() - - Loader { - id: headerBackgroundFullscreen - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - anchors.topMargin: Style.vspan(210/80) - active: root.state === "Maximized" - sourceComponent: HeaderBackgroundMaximized { - navigationMode: root.navigationMode - guidanceMode: root.guidanceMode - destinationButtonrowHeight: root.destinationButtonrowHeight - } - } - - Loader { - id: headerBackgroundWidget - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - active: root.state === "Widget2Rows" || root.state === "Widget3Rows" - sourceComponent: HeaderBackgroundWidget { - state: root.state - } - } - - Loader { - id: navigationSearchButtonsFullscreen - width: headerBackgroundFullscreen.width - Style.hspan(2) - height: headerBackgroundFullscreen.height - active: headerBackgroundFullscreen.active && !root.navigationMode - anchors.top: headerBackgroundFullscreen.top - anchors.topMargin: Style.vspan(1.4) - anchors.horizontalCenter: headerBackgroundFullscreen.horizontalCenter - sourceComponent: NavigationSearch { - onOpenSearchTextInput: root.openSearchTextInput() - } - } - - Loader { - id: navigationSearchButtonsWidget - width: headerBackgroundWidget.width - (184 * NeptuneStyle.scale) // compensate for the "expand" button in the widget corner - height: headerBackgroundWidget.height - active: headerBackgroundWidget.active - anchors.top: headerBackgroundWidget.top - anchors.topMargin: Style.vspan(.6) - anchors.horizontalCenter: headerBackgroundWidget.horizontalCenter - sourceComponent: NavigationSearch { - onOpenSearchTextInput: root.openSearchTextInput() - } - } - - Loader { - id: navigationConfirmButtons - anchors.fill: headerBackgroundFullscreen - anchors.rightMargin: Style.hspan(.5) - active: headerBackgroundFullscreen.active && root.navigationMode - sourceComponent: NavigationConfirm { - guidanceMode: root.guidanceMode - destination: root.destination - routeDistance: root.routeDistance - routeTime: root.routeTime - onStartNavigation: root.startNavigation() - onStopNavigation: root.stopNavigation() - } - - } - - Loader { - id: favoriteDestinationButtonsFullscreen - anchors.top: headerBackgroundFullscreen.top - anchors.topMargin: headerBackgroundFullscreen.height - height - anchors.left: headerBackgroundFullscreen.left - anchors.leftMargin: Style.hspan(1) - anchors.right: headerBackgroundFullscreen.right - anchors.rightMargin: Style.hspan(1.5) - height: root.destinationButtonrowHeight - active: headerBackgroundFullscreen.active && !root.navigationMode - sourceComponent: FavoriteDestinationButtons { - homeAddressData: root.homeAddressData - workAddressData: root.workAddressData - homeRouteTime: root.homeRouteTime - workRouteTime: root.workRouteTime - onShowRoute: root.showRoute(destCoord, description); - } - } - - Loader { - id: favoriteDestinationButtonsWidget - anchors.top: headerBackgroundWidget.top - anchors.topMargin: Style.vspan(2) - anchors.left: headerBackgroundWidget.left - anchors.leftMargin: Style.hspan(1) - anchors.right: headerBackgroundWidget.right - anchors.rightMargin: Style.hspan(1.5) - height: root.destinationButtonrowHeight - active: headerBackgroundWidget.active && root.state === "Widget3Rows" - sourceComponent: FavoriteDestinationButtons { - homeAddressData: root.homeAddressData - workAddressData: root.workAddressData - homeRouteTime: root.homeRouteTime - workRouteTime: root.workRouteTime - onShowRoute: root.showRoute(destCoord, description); - } - } -} diff --git a/apps/com.pelagicore.qtlocation/MapRouting.qml b/apps/com.pelagicore.qtlocation/MapRouting.qml deleted file mode 100644 index 90cee085..00000000 --- a/apps/com.pelagicore.qtlocation/MapRouting.qml +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Pelagicore AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 -import QtPositioning 5.9 -import QtLocation 5.9 - -QtObject { - id: root - - readonly property bool calculating: routeModel.status === RouteModel.Loading - readonly property alias model: routeModel - property string routeDistance - property string routeTime - property var routeSegments - property string homeRouteTime - property string workRouteTime - - property alias routingPlugin: routeModel.plugin - property var currentLocationCoord - property var homeCoord - property var workCoord - - property var startCoord: QtPositioning.coordinate() - property var destCoord: QtPositioning.coordinate() - - property string destination - - function formatMeters(meters) { - return qsTr("%n kilometer(s)", "", meters/1000) - } - - function formatSeconds(seconds) { - const numdays = Math.floor((seconds % 31536000) / 86400) - const numhours = Math.floor(((seconds % 31536000) % 86400) / 3600) - const numminutes = Math.ceil((((seconds % 31536000) % 86400) % 3600) / 60) - - var result = ""; - if (numdays > 0) - result += qsTr("%n day(s)", "", numdays) + ", "; - if (numhours > 0) - result += qsTr("%n hour(s)", "", numhours) + ", "; - if (numminutes > 0) - result += qsTr("%n minute(s)", "", numminutes); - - return result; - } - - readonly property RouteModel routeModel: RouteModel { - id: routeModel - autoUpdate: !!root.startCoord && !!root.destCoord - query: RouteQuery { - waypoints: [root.startCoord, root.destCoord] - } - onStatusChanged: { - if (status === RouteModel.Null) { - console.info("Route model idle"); - } else if (status === RouteModel.Ready) { - console.info("Route model ready, results:", count) - if (count > 0) { - root.routeDistance = formatMeters(get(0).distance); - root.routeTime = formatSeconds(get(0).travelTime); - root.routeSegments = get(0).segments; - console.info("Route distance (km):", root.routeDistance, ", time:", root.routeTime); - console.info("First coord:", root.routeSegments[0].path[0]) - } - } else if (status === RouteModel.Loading) { - console.info("Route model busy"); - } else if (status === RouteModel.Error) { - console.warn("Route model error:", error, errorString); - } - } - } - - readonly property RouteModel homeRouteModel: RouteModel { - autoUpdate: !!root.currentLocationCoord && !!root.homeCoord - query: RouteQuery { - waypoints: [root.currentLocationCoord, root.homeCoord] - } - plugin: Plugin { name: "osm" } - - onStatusChanged: { - if (status === RouteModel.Ready) { - if (count > 0) { - root.homeRouteTime = formatSeconds(get(0).travelTime); - console.info("Home route distance (km):", formatMeters(get(0).distance), ", time:", root.homeRouteTime) - } - } - } - } - - readonly property RouteModel workRouteModel: RouteModel { - autoUpdate: !!root.currentLocationCoord && !!root.workCoord - query: RouteQuery { - waypoints: [root.currentLocationCoord, root.workCoord] - } - plugin: Plugin { name: "osm" } - onStatusChanged: { - if (status === RouteModel.Ready) { - if (count > 0) { - root.workRouteTime = formatSeconds(get(0).travelTime); - console.info("Work route distance (km):", formatMeters(get(0).distance), ", time:", root.workRouteTime) - } - } - } - } -} diff --git a/apps/com.pelagicore.qtlocation/MapSearchTextField.qml b/apps/com.pelagicore.qtlocation/MapSearchTextField.qml deleted file mode 100644 index 4b8b9eb7..00000000 --- a/apps/com.pelagicore.qtlocation/MapSearchTextField.qml +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.6 -import QtQuick.Controls 2.0 -import utils 1.0 -import com.pelagicore.styles.neptune 3.0 - -TextField { - id: root - - property alias busy: searchBusyIndicator.running - - font.family: NeptuneStyle.fontFamily - font.pixelSize: NeptuneStyle.fontSizeM - color: NeptuneStyle.primaryTextColor - selectedTextColor: NeptuneStyle.highlightedTextColor - leftPadding: Style.hspan(0.4) - rightPadding: Style.hspan(1.4) - horizontalAlignment: TextInput.AlignLeft - - background: Rectangle { - border.color: NeptuneStyle.buttonColor - border.width: 1 - color: "transparent" - radius: height/2 - Item { - anchors.fill: parent - Image { - id: iconSearch - anchors.right: parent.right - anchors.rightMargin: Style.hspan(0.4) - anchors.verticalCenter: parent.verticalCenter - source: Style.localAsset("ic-search", NeptuneStyle.theme) - visible: !searchBusyIndicator.visible - } - BusyIndicator { - id: searchBusyIndicator - anchors.right: parent.right - anchors.rightMargin: Style.hspan(0.4) - anchors.verticalCenter: parent.verticalCenter - visible: running - } - } - } -} diff --git a/apps/com.pelagicore.qtlocation/MapToolButton.qml b/apps/com.pelagicore.qtlocation/MapToolButton.qml deleted file mode 100644 index 12107570..00000000 --- a/apps/com.pelagicore.qtlocation/MapToolButton.qml +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 -import QtQuick.Controls 2.2 -import utils 1.0 -import com.pelagicore.styles.neptune 3.0 - -ToolButton { - id: root - property alias iconSource: buttonImage.source - property color labelColor: NeptuneStyle.primaryTextColor - - property string primaryText - - property string extendedText: "" - property color extendedTextColor: NeptuneStyle.highlightedTextColor - property int extendedTextFontSize: NeptuneStyle.fontSizeS - - property string secondaryText: "" - property color secondaryTextColor: NeptuneStyle.primaryTextColor - property int secondaryTextFontSize: NeptuneStyle.fontSizeS - - background: Item { - Row { - spacing: Style.hspan(0.5) - anchors.centerIn: parent - Image { - id: buttonImage - anchors.verticalCenter: parent.verticalCenter - } - Column { - spacing: Style.hspan(0.1) - anchors.verticalCenter: parent.verticalCenter - Row { - spacing: Style.hspan(0.3) - Label { - id: primaryButtonText - anchors.verticalCenter: parent.verticalCenter - color: root.labelColor - text: root.primaryText - } - Label { - id: extendedButtonText - anchors.verticalCenter: parent.verticalCenter - color: root.extendedTextColor - font.pixelSize: root.extendedTextFontSize - text: root.extendedText - } - } - Label { - id: secondaryButtonText - color: root.secondaryTextColor - font.pixelSize: root.secondaryTextFontSize - font.weight: Font.Light - text: root.secondaryText - } - } - } - } -} diff --git a/apps/com.pelagicore.qtlocation/MapView.qml b/apps/com.pelagicore.qtlocation/MapView.qml deleted file mode 100644 index ca40b0d3..00000000 --- a/apps/com.pelagicore.qtlocation/MapView.qml +++ /dev/null @@ -1,230 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.3 -import QtLocation 5.9 -import QtPositioning 5.9 - -import utils 1.0 -import com.pelagicore.styles.neptune 3.0 -import controls 1.0 as NeptuneControls -import animations 1.0 - -Item { - id: root - - property alias mapInteractive: mainMap.enabled - property alias plugin: mainMap.plugin - property alias center: mainMap.center - property alias visibleRegion: mainMap.visibleRegion - readonly property alias mapReady: mainMap.mapReady - property alias activeMapType: mainMap.activeMapType - readonly property alias supportedMapTypes: mainMap.supportedMapTypes - property alias tilt: mainMap.tilt - property alias bearing: mainMap.bearing - property alias zoomLevel: mainMap.zoomLevel - - property bool offlineMapsEnabled - property bool navigationMode - property bool guidanceMode - property alias routingPlugin: mapRouting.routingPlugin - property alias startCoord: mapRouting.startCoord - property alias destCoord: mapRouting.destCoord - property alias destination: mapRouting.destination - property var currentLocation - - signal openSearchTextInput() - signal maximizeMap() - signal startNavigationRequested() - signal stopNavigationRequested() - signal showRouteRequested() - - function zoomIn() { - mainMap.zoomLevel += 1.0; - } - - function zoomOut() { - mainMap.zoomLevel -= 1.0; - } - - Map { - id: mainMap - anchors.fill: parent - anchors.topMargin: (root.state === "Widget3Rows") ? header.height/2 : 0 - Behavior on anchors.topMargin { DefaultNumberAnimation {} } - Behavior on center { enabled: root.mapInteractive; CoordinateAnimation { easing.type: Easing.InOutCirc; duration: 540 } } - Behavior on tilt { DefaultSmoothedAnimation {} } - zoomLevel: 10 - copyrightsVisible: false // customize the default (c) appearance below in MapCopyrightNotice - gesture { - enabled: root.mapInteractive - // effectively disable the rotation gesture - acceptedGestures: MapGestureArea.PanGesture | MapGestureArea.PinchGesture | MapGestureArea.FlickGesture - } - - onErrorChanged: { - console.warn("Map error:", error, errorString) - } - - MapRouting { - id: mapRouting - currentLocationCoord: root.currentLocation - homeCoord: header.homeAddressData - workCoord: header.workAddressData - } - - MapItemView { - autoFitViewport: true - model: root.guidanceMode ? mapRouting.model : null - delegate: MapRoute { - route: routeData - line.color: "#798bd9" - line.width: 3 - smooth: true - opacity: NeptuneStyle.fontOpacityHigh - } - } - - MapQuickItem { - id: destMarker - anchorPoint: Qt.point(markerImage.width * 0.5, markerImage.height * 0.8) - coordinate: mapRouting.destCoord ? mapRouting.destCoord : QtPositioning.coordinate() - visible: root.navigationMode && mapRouting.destCoord.isValid - - sourceItem: Image { - id: markerImage - source: Qt.resolvedUrl("assets/pin-destination.png") - width: 139/2 - height: 161/2 - } - } - - MapQuickItem { - id: posMarker - anchorPoint: Qt.point(posImage.width * 0.5, posImage.height * 0.5) - coordinate: mapRouting.routeSegments && mapRouting.routeSegments[0] ? mapRouting.routeSegments[0].path[0] - : QtPositioning.coordinate() - visible: root.guidanceMode - - sourceItem: Image { - id: posImage - source: Qt.resolvedUrl("assets/pin-your-position.png") - width: 116/2 - height: 135/2 - } - rotation: mapRouting.routeSegments ? mapRouting.routeSegments[0].path[0].azimuthTo(mapRouting.routeSegments[0].path[1]) - : 0 - } - } - - Image { - id: mask - anchors.fill: mainMap - source: Style.localAsset("bg-home-navigation-overlay", NeptuneStyle.theme) - visible: root.state === "Maximized" - scale: root.state === "Maximized" ? 1 : 1.6 - Behavior on scale { - DefaultNumberAnimation { } - } - } - - MapHeader { - id: header - anchors.left: parent.left - anchors.right: parent.right - anchors.rightMargin: guidanceMode ? Style.hspan(18) : 0 - anchors.top: parent.top - opacity: root.state !== "Widget1Row" && !offlineMapsEnabled ? 1 : 0 - Behavior on opacity { DefaultNumberAnimation {} } - Behavior on anchors.rightMargin { DefaultNumberAnimation {} } - visible: opacity > 0 - state: root.state - - offlineMapsEnabled: root.offlineMapsEnabled - navigationMode: root.navigationMode - guidanceMode: root.guidanceMode - currentLocation: root.currentLocation - destination: mapRouting.destination - routeDistance: mapRouting.routeDistance - routeTime: mapRouting.routeTime - homeRouteTime: mapRouting.homeRouteTime - workRouteTime: mapRouting.workRouteTime - - onOpenSearchTextInput: root.openSearchTextInput() - onStartNavigation: { - root.startNavigationRequested(); - root.maximizeMap(); - root.guidanceMode = true; - } - onStopNavigation: { - root.stopNavigationRequested(); - root.navigationMode = false; - root.guidanceMode = false; - } - onShowRoute: { - root.showRouteRequested(); - root.center = destCoord; - root.startCoord = root.currentLocation; - root.destCoord = destCoord; - root.destination = description; - root.navigationMode = true; - root.maximizeMap(); - } - } - - NeptuneControls.Tool { - anchors.left: parent.left - anchors.leftMargin: Style.hspan(0.6) - anchors.top: offlineMapsEnabled ? parent.top : header.bottom - anchors.topMargin: Style.vspan(3) - checkable: true - opacity: root.state === "Maximized" ? 1 : 0 - Behavior on opacity { DefaultNumberAnimation {} } - visible: opacity > 0 - background: Image { - fillMode: Image.Pad - source: Style.localAsset("floating-button-bg", NeptuneStyle.theme) - } - symbol: checked ? Qt.resolvedUrl("assets/ic-3D_ON.png") : Qt.resolvedUrl("assets/ic-3D_OFF.png") - onClicked: mainMap.tilt = checked ? mainMap.maximumTilt : mainMap.minimumTilt; - } - - MapCopyrightNotice { - anchors.left: mainMap.left - anchors.bottom: mainMap.bottom - anchors.leftMargin: Style.hspan(.5) - mapSource: mainMap - styleSheet: "* { color: '%1'; font-family: '%2'; font-size: %3px}" - .arg(NeptuneStyle.primaryTextColor).arg(NeptuneStyle.fontFamily).arg(NeptuneStyle.fontSizeXXS) - } -} diff --git a/apps/com.pelagicore.qtlocation/Maps.qml b/apps/com.pelagicore.qtlocation/Maps.qml deleted file mode 100644 index 84cc3d8d..00000000 --- a/apps/com.pelagicore.qtlocation/Maps.qml +++ /dev/null @@ -1,323 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017-2018 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.3 -import QtPositioning 5.9 -import QtLocation 5.9 -import QtGraphicalEffects 1.0 - -import Qt.labs.platform 1.0 - -import utils 1.0 -import controls 1.0 as NeptuneControls -import animations 1.0 - -import com.pelagicore.styles.neptune 3.0 - -Item { - id: root - - property bool offlineMapsEnabled - onOfflineMapsEnabledChanged: getAvailableMapsAndLocation() - - // props for secondary window - property alias mapInteractive: mainMap.mapInteractive - property alias mapCenter: mainMap.center - property alias mapZoomLevel: mainMap.zoomLevel - property alias mapTilt: mainMap.tilt - property alias mapBearing: mainMap.bearing - readonly property alias mapReady: mainMap.mapReady - - property bool searchViewEnabled: false - - signal maximizeMap() - - function fetchCurrentLocation() { // PositionSource doesn't work on Linux - var req = new XMLHttpRequest; - req.onreadystatechange = function() { - if (req.readyState === XMLHttpRequest.DONE) { - var objectArray = JSON.parse(req.responseText); - if (objectArray.errors !== undefined) { - console.warn("Error fetching location:", objectArray.errors[0].message); - } else { - priv.positionCoordinate = QtPositioning.coordinate(objectArray.location.lat, objectArray.location.lng); - console.info("Current location:", priv.positionCoordinate); - } - } - } - req.open("GET", "https://location.services.mozilla.com/v1/geolocate?key=geoclue"); - req.send(); - } - - function getAvailableMapsAndLocation() { - if (mainMap.mapReady) { - mapTypeModel.clear(); - console.info("Supported map types:"); - for (var i = 0; i < mainMap.supportedMapTypes.length; i++) { - var map = mainMap.supportedMapTypes[i]; - mapTypeModel.append({"name": map.name, "data": map}) // fill the map type model - console.info("\t", map.name, ", description:", map.description, ", style:", map.style, ", night mode:", map.night); - } - if (!root.offlineMapsEnabled) { - fetchCurrentLocation(); - } - } - } - - function getMapType(name) { - if (!mainMap.mapReady || !mapTypeModel.count) { - return - } - for (var i = 0; i < mapTypeModel.count; i++) { - var map = mapTypeModel.get(i); - if (map && map.name === name) { - return map.data; - } - } - } - - QtObject { - id: priv - readonly property var plugins: ["mapboxgl", "osm"] - property var positionCoordinate: offlineMapsEnabled ? QtPositioning.coordinate(57.709912, 11.966632) // Gothenburg - : QtPositioning.coordinate(49.5938686, 17.2508706) // Olomouc - property var originalPosition: positionCoordinate - readonly property string defaultLightThemeId: "mapbox://styles/qtauto/cjcm1by3q12dk2sqnquu0gju9" - readonly property string defaultDarkThemeId: "mapbox://styles/qtauto/cjcm1czb812co2sno1ypmp1r8" - } - - ListModel { - // lists the various map styles (including the custom ones); filled in Map.onMapReadyChanged - id: mapTypeModel - } - - Plugin { - id: mapPlugin - locales: Style.languageLocale - preferred: priv.plugins - - readonly property string cacheDirUrl: StandardPaths.writableLocation(StandardPaths.CacheLocation); - - // Mapbox Plugin Parameters - PluginParameter { - name: "mapboxgl.access_token" - value: "pk.eyJ1IjoicXRhdXRvIiwiYSI6ImNqY20wbDZidzBvcTQyd3J3NDlkZ21jdjUifQ.4KYDlP7UmQEVPYffr6VuVQ" - } - PluginParameter { - name: "mapboxgl.mapping.additional_style_urls" - value: [priv.defaultLightThemeId, priv.defaultDarkThemeId].join(",") - } - - // OSM Plugin Parameters - PluginParameter { name: "osm.useragent"; value: "Neptune UI" } - - // Offline maps support - PluginParameter { name: "mapboxgl.mapping.cache.directory"; - // needs to be an absolute filepath so strip the file:/// protocol; several leading slashes don't matter - value: mapPlugin.cacheDirUrl.toString().substring(mapPlugin.cacheDirUrl.indexOf(':')+1) } - } - - // This is needed since MapBox plugin does not support geocoding yet. TODO: find a better way to support geocoding. - Plugin { - id: geocodePlugin - name: "osm" - locales: Style.languageLocale - - // OSM Plugin Parameters - PluginParameter { name: "osm.useragent"; value: "Neptune UI" } - } - - GeocodeModel { - id: geocodeModel - plugin: geocodePlugin - limit: 20 - } - - MapView { - id: mainMap - anchors.fill: parent - plugin: mapPlugin - routingPlugin: geocodePlugin - center: priv.positionCoordinate - state: root.state - currentLocation: priv.positionCoordinate - offlineMapsEnabled: root.offlineMapsEnabled - activeMapType: { - if (!mapReady || plugin.name !== "mapboxgl") { - return supportedMapTypes[0]; - } - return NeptuneStyle.theme === NeptuneStyle.Light ? getMapType(priv.defaultLightThemeId) : getMapType(priv.defaultDarkThemeId); - } - onOpenSearchTextInput: { - root.maximizeMap(); - searchViewEnabled = true; - } - onStartNavigationRequested: { - priv.originalPosition = priv.positionCoordinate; - } - onShowRouteRequested: { - priv.originalPosition = priv.positionCoordinate; - } - onStopNavigationRequested: { - priv.positionCoordinate = priv.originalPosition; - mainMap.center = priv.positionCoordinate; - } - - onMapReadyChanged: getAvailableMapsAndLocation(); - onMaximizeMap: root.maximizeMap() - } - - NeptuneControls.Tool { - anchors.left: parent.left - anchors.leftMargin: Style.hspan(0.6) - anchors.top: parent.top - anchors.topMargin: Style.vspan(0.6) - opacity: root.state === "Widget1Row" ? 1 : 0 - Behavior on opacity { DefaultNumberAnimation {} } - visible: opacity > 0 - symbol: Qt.resolvedUrl("assets/ic-search.png") - background: Image { - fillMode: Image.Pad - source: Style.localAsset("floating-button-bg", NeptuneStyle.theme) - } - onClicked: root.maximizeMap() - } - - FastBlur { - anchors.fill: mainMap - source: mainMap - radius: 64 - visible: searchViewEnabled - } - - BorderImage { - id: overlay - anchors.fill: root - border.top: 322 - border.bottom: 323 - border.left: 0 - border.right: 0 - source: Style.gfx2("input-overlay") - visible: searchViewEnabled - } - - ColumnLayout { - id: searchOverlay - anchors.fill: root - anchors.topMargin: Style.vspan(1) - visible: searchViewEnabled - spacing: Style.vspan(1) - - NeptuneControls.Tool { - anchors.left: parent.left - anchors.leftMargin: Style.hspan(1) - symbol: Style.symbol("ic_back") - onClicked: searchViewEnabled = false - text: qsTr("Back") - } - - MapSearchTextField { - id: searchField - anchors.left: parent.left - anchors.leftMargin: Style.hspan(2) - anchors.right: parent.right - anchors.rightMargin: Style.hspan(2) - selectByMouse: true - focus: searchViewEnabled - busy: geocodeModel.status == GeocodeModel.Loading - onAccepted: { - geocodeModel.query = searchField.text; - geocodeModel.update(); - searchViewEnabled = false; - } - onTextChanged: { - if (text.length > 1) { - searchTimer.restart(); - } else { - searchTimer.stop(); - geocodeModel.reset(); - } - } - Keys.onEscapePressed: searchViewEnabled = false - } - - ListView { - id: searchResultsList - Layout.fillHeight: true - anchors.left: parent.left - anchors.leftMargin: Style.hspan(2) - anchors.right: parent.right - anchors.rightMargin: Style.hspan(2) - clip: true - model: geocodeModel - visible: searchViewEnabled - state: root.state - delegate: NeptuneControls.ListItem { - id: itemDelegate - width: parent.width - height: Style.vspan(1.5) - readonly property string addressText: locationData.address.text - readonly property string city: locationData.address.city - readonly property string country: locationData.address.country - text: addressText - subText: itemDelegate.city !== "" ? itemDelegate.city + ", " + itemDelegate.country : itemDelegate.country; - onClicked: { - searchViewEnabled = false; - mainMap.center = locationData.coordinate; - mainMap.startCoord = priv.positionCoordinate; - mainMap.destCoord = locationData.coordinate; - mainMap.destination = itemDelegate.addressText; - if (locationData.boundingBox.isValid) { - mainMap.visibleRegion = locationData.boundingBox; - } - mainMap.navigationMode = true; - } - } - onStateChanged: { - if (state !== "Maximized") { - searchViewEnabled = false; - } - } - ScrollIndicator.vertical: ScrollIndicator {} - } - } - - Timer { - id: searchTimer - interval: 500 - onTriggered: { - geocodeModel.query = searchField.text; - geocodeModel.update(); - } - } -} diff --git a/apps/com.pelagicore.qtlocation/NavigationConfirm.qml b/apps/com.pelagicore.qtlocation/NavigationConfirm.qml deleted file mode 100644 index d894c185..00000000 --- a/apps/com.pelagicore.qtlocation/NavigationConfirm.qml +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Pelagicore AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 -import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.3 - -import controls 1.0 as NeptuneControls -import utils 1.0 -import com.pelagicore.styles.neptune 3.0 - -Row { - id: root - - property bool guidanceMode: false - property string destination: "" - property string routeDistance: "" - property string routeTime: "" - - signal startNavigation() - signal stopNavigation() - - spacing: Style.hspan(.5) - - NeptuneControls.Tool { - width: Style.hspan(.9) - height: width - visible: root.guidanceMode - symbol: Qt.resolvedUrl("assets/ic-end-route.png") - onClicked: root.stopNavigation() - } - - RowLayout { - width: root.guidanceMode ? parent.width : parent.width / 2 - anchors.verticalCenter: parent.verticalCenter - spacing: Style.hspan(.7) - - NeptuneControls.Tool { - Layout.leftMargin: parent.spacing - width: Style.hspan(1) - height: width - enabled: visible - visible: !root.guidanceMode - symbol: Style.symbol("ic_back") - onClicked: root.stopNavigation() - } - - Column { - Layout.fillWidth: true - Label { - width: parent.width - wrapMode: Text.WordWrap - font.pixelSize: NeptuneStyle.fontSizeS - text: destination - } - Label { - width: parent.width - wrapMode: Text.WordWrap - font.pixelSize: NeptuneStyle.fontSizeXS - text: "%1 · %2".arg(routeDistance).arg(routeTime) - } - } - } - - Button { - id: startNavigationButton - width: parent.width / 3 - height: Style.vspan(1) - anchors.verticalCenter: parent.verticalCenter - scale: pressed ? 1.1 : 1.0 - visible: !root.guidanceMode - Behavior on scale { NumberAnimation { duration: 50 } } - - contentItem: Item { - Row { - anchors.centerIn: parent - spacing: Style.hspan(0.3) - Image { - anchors.verticalCenter: parent.verticalCenter - fillMode: Image.Pad - source: Style.localAsset("ic-start-navigation", NeptuneStyle.theme) - opacity: startNavigationButton.enabled ? NeptuneStyle.fontOpacityHigh : NeptuneStyle.fontOpacityDisabled - } - Label { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Start Navigation") - font.pixelSize: NeptuneStyle.fontSizeS - } - } - } - onClicked: root.startNavigation() - } -} diff --git a/apps/com.pelagicore.qtlocation/NavigationSearch.qml b/apps/com.pelagicore.qtlocation/NavigationSearch.qml deleted file mode 100644 index fccda397..00000000 --- a/apps/com.pelagicore.qtlocation/NavigationSearch.qml +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Pelagicore AB -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.8 -import QtQuick.Controls 2.2 - -import controls 1.0 as NeptuneControls -import utils 1.0 -import com.pelagicore.styles.neptune 3.0 - -Row { - id: root - - signal openSearchTextInput() - - spacing: Style.hspan(.5) - - Item { - width: parent.width/2 - height: parent.height - Label { - width: parent.width/2 - wrapMode: Text.WordWrap - maximumLineCount: 2 - elide: Label.ElideRight - font.pixelSize: NeptuneStyle.fontSizeS - text: qsTr("Where do you wanna go today?") - } - } - - Button { - id: searchButton - width: parent.width / 2 - height: Style.vspan(.9) - scale: pressed ? 1.1 : 1.0 - Behavior on scale { NumberAnimation { duration: 50 } } - - contentItem: Item { - Row { - anchors.centerIn: parent - spacing: Style.hspan(0.3) - Image { - anchors.verticalCenter: parent.verticalCenter - fillMode: Image.Pad - source: Style.localAsset("ic-search", NeptuneStyle.theme) - } - Label { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Search") - font.pixelSize: NeptuneStyle.fontSizeS - } - } - } - onClicked: root.openSearchTextInput() - } -} diff --git a/apps/com.pelagicore.qtlocation/StandAlone.qml b/apps/com.pelagicore.qtlocation/StandAlone.qml deleted file mode 100644 index 5abc716d..00000000 --- a/apps/com.pelagicore.qtlocation/StandAlone.qml +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Neptune 3 IVI UI. -** -** $QT_BEGIN_LICENSE:GPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: GPL-3.0 -** -****************************************************************************/ - -import QtQuick 2.9 -import QtQuick.Window 2.3 - -import utils 1.0 -import com.pelagicore.styles.neptune 3.0 - -Window { - id: root - width: 1080 - height: 1920 - - color: root.contentItem.NeptuneStyle.theme === NeptuneStyle.Dark ? "black" : "white" - - Binding { target: Style; property: "cellWidth"; value: root.width / 24 } - Binding { target: Style; property: "cellHeight"; value: root.height / 24 } - Binding { target: Style; property: "assetPath"; value: Qt.resolvedUrl("/opt/neptune3/imports/assets/") } - - Shortcut { - sequence: "Ctrl+t" - context: Qt.ApplicationShortcut - onActivated: { - var otherTheme = root.contentItem.NeptuneStyle.theme === NeptuneStyle.Dark ? NeptuneStyle.Light - : NeptuneStyle.Dark; - root.contentItem.NeptuneStyle.theme = otherTheme; - } - } - - Maps { - anchors.fill: parent - state: "Maximized" - } -} diff --git a/apps/com.pelagicore.qtlocation/controls/MapSearchTextField.qml b/apps/com.pelagicore.qtlocation/controls/MapSearchTextField.qml new file mode 100644 index 00000000..ee72e2bd --- /dev/null +++ b/apps/com.pelagicore.qtlocation/controls/MapSearchTextField.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.6 +import QtQuick.Controls 2.0 +import utils 1.0 +import com.pelagicore.styles.neptune 3.0 +import "../helpers" + +TextField { + id: root + + property alias busy: searchBusyIndicator.running + property Helper helper: Helper {} + + font.family: NeptuneStyle.fontFamily + font.pixelSize: NeptuneStyle.fontSizeM + color: NeptuneStyle.primaryTextColor + selectedTextColor: NeptuneStyle.highlightedTextColor + leftPadding: Style.hspan(0.4) + rightPadding: Style.hspan(1.4) + horizontalAlignment: TextInput.AlignLeft + + background: Rectangle { + border.color: NeptuneStyle.buttonColor + border.width: 1 + color: "transparent" + radius: height/2 + Item { + anchors.fill: parent + Image { + id: iconSearch + anchors.right: parent.right + anchors.rightMargin: Style.hspan(0.4) + anchors.verticalCenter: parent.verticalCenter + source: helper.localAsset("ic-search", NeptuneStyle.theme) + visible: !searchBusyIndicator.visible + } + BusyIndicator { + id: searchBusyIndicator + anchors.right: parent.right + anchors.rightMargin: Style.hspan(0.4) + anchors.verticalCenter: parent.verticalCenter + visible: running + } + } + } +} diff --git a/apps/com.pelagicore.qtlocation/controls/MapToolButton.qml b/apps/com.pelagicore.qtlocation/controls/MapToolButton.qml new file mode 100644 index 00000000..12107570 --- /dev/null +++ b/apps/com.pelagicore.qtlocation/controls/MapToolButton.qml @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2017 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 +import utils 1.0 +import com.pelagicore.styles.neptune 3.0 + +ToolButton { + id: root + property alias iconSource: buttonImage.source + property color labelColor: NeptuneStyle.primaryTextColor + + property string primaryText + + property string extendedText: "" + property color extendedTextColor: NeptuneStyle.highlightedTextColor + property int extendedTextFontSize: NeptuneStyle.fontSizeS + + property string secondaryText: "" + property color secondaryTextColor: NeptuneStyle.primaryTextColor + property int secondaryTextFontSize: NeptuneStyle.fontSizeS + + background: Item { + Row { + spacing: Style.hspan(0.5) + anchors.centerIn: parent + Image { + id: buttonImage + anchors.verticalCenter: parent.verticalCenter + } + Column { + spacing: Style.hspan(0.1) + anchors.verticalCenter: parent.verticalCenter + Row { + spacing: Style.hspan(0.3) + Label { + id: primaryButtonText + anchors.verticalCenter: parent.verticalCenter + color: root.labelColor + text: root.primaryText + } + Label { + id: extendedButtonText + anchors.verticalCenter: parent.verticalCenter + color: root.extendedTextColor + font.pixelSize: root.extendedTextFontSize + text: root.extendedText + } + } + Label { + id: secondaryButtonText + color: root.secondaryTextColor + font.pixelSize: root.secondaryTextFontSize + font.weight: Font.Light + text: root.secondaryText + } + } + } + } +} diff --git a/apps/com.pelagicore.qtlocation/helpers/Helper.qml b/apps/com.pelagicore.qtlocation/helpers/Helper.qml new file mode 100644 index 00000000..5c94d7be --- /dev/null +++ b/apps/com.pelagicore.qtlocation/helpers/Helper.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.10 +import com.pelagicore.styles.neptune 3.0 + +QtObject { + id: root + + function localAsset(asset, theme) { + var themeStr = theme === NeptuneStyle.Dark ? "-dark" : ""; + return "../assets/" + asset + themeStr + '.png' + } +} diff --git a/apps/com.pelagicore.qtlocation/helpers/StandAlone.qml b/apps/com.pelagicore.qtlocation/helpers/StandAlone.qml new file mode 100644 index 00000000..0d24a79e --- /dev/null +++ b/apps/com.pelagicore.qtlocation/helpers/StandAlone.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Window 2.3 + +import utils 1.0 +import com.pelagicore.styles.neptune 3.0 + +import ".." + +Window { + id: root + width: 1080 + height: 1920 + + color: root.contentItem.NeptuneStyle.theme === NeptuneStyle.Dark ? "black" : "white" + + Binding { target: Style; property: "cellWidth"; value: root.width / 24 } + Binding { target: Style; property: "cellHeight"; value: root.height / 24 } + Binding { target: Style; property: "assetPath"; value: Qt.resolvedUrl("/opt/neptune3/imports/assets/") } + + Shortcut { + sequence: "Ctrl+t" + context: Qt.ApplicationShortcut + onActivated: { + var otherTheme = root.contentItem.NeptuneStyle.theme === NeptuneStyle.Dark ? NeptuneStyle.Light + : NeptuneStyle.Dark; + root.contentItem.NeptuneStyle.theme = otherTheme; + } + } + + Maps { + anchors.fill: parent + state: "Maximized" + } +} diff --git a/apps/com.pelagicore.qtlocation/helpers/run-standalone.sh b/apps/com.pelagicore.qtlocation/helpers/run-standalone.sh new file mode 100755 index 00000000..236674bc --- /dev/null +++ b/apps/com.pelagicore.qtlocation/helpers/run-standalone.sh @@ -0,0 +1,2 @@ +#!/bin/sh +SERVER_CONF_PATH=/opt/neptune3/server.conf QT_PLUGIN_PATH=/opt/neptune3:$QT_PLUGIN_PATH QT_QUICK_CONTROLS_CONF=/opt/neptune3/styles/1080x1920Neptune.conf QT_QUICK_CONTROLS_STYLE_PATH=/opt/neptune3/styles/ QT_QUICK_CONTROLS_STYLE=neptune qmlscene StandAlone.qml -I /opt/neptune3/imports/shared/ diff --git a/apps/com.pelagicore.qtlocation/panels/FavDestinationButtonsPanel.qml b/apps/com.pelagicore.qtlocation/panels/FavDestinationButtonsPanel.qml new file mode 100644 index 00000000..528b552b --- /dev/null +++ b/apps/com.pelagicore.qtlocation/panels/FavDestinationButtonsPanel.qml @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Layouts 1.3 +import QtPositioning 5.9 + +import animations 1.0 +import utils 1.0 +import com.pelagicore.styles.neptune 3.0 +import "../controls" +import "../helpers" + +Item { + id: root + + property var homeAddressData + property var workAddressData + + property string homeRouteTime: "" + property string workRouteTime: "" + + property Helper helper: Helper {} + + signal showRoute(var destCoord, string description) + + RowLayout { + anchors.fill: parent + MapToolButton { + id: buttonGoHome + Layout.preferredWidth: root.width/2 + anchors.verticalCenter: parent.verticalCenter + iconSource: helper.localAsset("ic-home", NeptuneStyle.theme) + primaryText: qsTr("Home") + extendedText: homeRouteTime + //TODO: add properties to the root object to access this externally + secondaryText: "Welandergatan 29" + onClicked: root.showRoute(root.homeAddressData, secondaryText) + } + Rectangle { + width: 1 + height: parent.height + opacity: NeptuneStyle.fontOpacityDisabled + color: NeptuneStyle.primaryTextColor + } + MapToolButton { + id: buttonGoWork + Layout.preferredWidth: root.width/2 + anchors.verticalCenter: parent.verticalCenter + iconSource: helper.localAsset("ic-work", NeptuneStyle.theme) + primaryText: qsTr("Work") + extendedText: workRouteTime + //TODO: add properties to the root object to access this externally + secondaryText: "Östra Hamngatan 16" + onClicked: root.showRoute(root.workAddressData, secondaryText) + } + } +} diff --git a/apps/com.pelagicore.qtlocation/panels/HeaderBackgroundMaximizedPanel.qml b/apps/com.pelagicore.qtlocation/panels/HeaderBackgroundMaximizedPanel.qml new file mode 100644 index 00000000..65ccb05a --- /dev/null +++ b/apps/com.pelagicore.qtlocation/panels/HeaderBackgroundMaximizedPanel.qml @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 + +import utils 1.0 +import animations 1.0 + +import com.pelagicore.styles.neptune 3.0 +import "../helpers" + +Item { + id: root + + property int destinationButtonrowHeight: 0 + property bool navigationMode: false + property bool guidanceMode: false + property Helper helper: Helper {} + + height: destinationButtonsPanel.visible ? destinationButtonsPanel.sourceSize.height : searchPanel.height + + BorderImage { + id: outerShadow + anchors.top: destinationButtonsPanel.top + anchors.topMargin: -40 + anchors.left: destinationButtonsPanel.left + anchors.right: destinationButtonsPanel.right + anchors.rightMargin: -Style.vspan(.5) + height: root.navigationMode && !root.guidanceMode ? sourceSize.height - root.destinationButtonrowHeight : sourceSize.height + source: helper.localAsset("panel-shadow", NeptuneStyle.theme) + border { + left: 0 + top: 101 + right: 101 + bottom: 106 + } + } + + BorderImage { + id: destinationButtonsPanel + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.rightMargin: -Style.vspan(1) + source: helper.localAsset("panel-more-contrast-background", NeptuneStyle.theme) + visible: !root.navigationMode || root.guidanceMode + border { + left: 0 + top: 20 + right: 32 + bottom: 22 + } + } + + Image { + id: innerShadow + anchors.top: searchPanel.bottom + anchors.right: searchPanel.right + anchors.left: searchPanel.left + width: searchPanel.width + source: Style.gfx2("panel-inner-shadow", NeptuneStyle.theme) + } + + BorderImage { + id: searchPanel + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.rightMargin: -Style.vspan(1) + height: root.guidanceMode ? sourceSize.height : destinationButtonsPanel.sourceSize.height - root.destinationButtonrowHeight + source: helper.localAsset("panel-background", NeptuneStyle.theme) + border { + left: 0 + top: 20 + right: 22 + bottom: 0 + } + } +} diff --git a/apps/com.pelagicore.qtlocation/panels/HeaderBackgroundWidgetPanel.qml b/apps/com.pelagicore.qtlocation/panels/HeaderBackgroundWidgetPanel.qml new file mode 100644 index 00000000..9abd2e76 --- /dev/null +++ b/apps/com.pelagicore.qtlocation/panels/HeaderBackgroundWidgetPanel.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 + +import utils 1.0 +import animations 1.0 + +import com.pelagicore.styles.neptune 3.0 +import "../helpers" + +Item { + id: root + + property Helper helper: Helper {} + height: widgetBackgroundImage.height + + Image { + id: widgetBackgroundImage + height: root.state === "Widget3Rows" ? sourceSize.height : sourceSize.height/2 + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + fillMode: Image.TileHorizontally + source: helper.localAsset("navigation-widget-overlay-top", NeptuneStyle.theme) + Behavior on height { DefaultNumberAnimation {} } + } +} diff --git a/apps/com.pelagicore.qtlocation/panels/MapBoxPanel.qml b/apps/com.pelagicore.qtlocation/panels/MapBoxPanel.qml new file mode 100644 index 00000000..039ed4c3 --- /dev/null +++ b/apps/com.pelagicore.qtlocation/panels/MapBoxPanel.qml @@ -0,0 +1,230 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 +import QtLocation 5.9 +import QtPositioning 5.9 + +import utils 1.0 +import com.pelagicore.styles.neptune 3.0 +import controls 1.0 as NeptuneControls +import animations 1.0 +import "../controls" +import "../helpers" + +Item { + id: root + + property alias mapInteractive: mainMap.enabled + property alias plugin: mainMap.plugin + property alias center: mainMap.center + property alias visibleRegion: mainMap.visibleRegion + readonly property alias mapReady: mainMap.mapReady + property alias activeMapType: mainMap.activeMapType + readonly property alias supportedMapTypes: mainMap.supportedMapTypes + property alias tilt: mainMap.tilt + property alias bearing: mainMap.bearing + property alias zoomLevel: mainMap.zoomLevel + property alias mapHeader: header + + property string destination + property RouteModel model + property string routeDistance + property string routeTime + property var routeSegments + property string homeRouteTime + property string workRouteTime + property var destCoord: QtPositioning.coordinate() + + property bool offlineMapsEnabled + property bool navigationMode + property bool guidanceMode + property var currentLocation + + property Helper helper: Helper {} + + signal openSearchTextInput() + signal maximizeMap() + signal startNavigationRequested() + signal stopNavigationRequested() + signal showRouteRequested(var destCoord, var description) + + function zoomIn() { + mainMap.zoomLevel += 1.0; + } + + function zoomOut() { + mainMap.zoomLevel -= 1.0; + } + + Map { + id: mainMap + anchors.fill: parent + anchors.topMargin: (root.state === "Widget3Rows") ? header.height/2 : 0 + Behavior on anchors.topMargin { DefaultNumberAnimation {} } + Behavior on center { enabled: root.mapInteractive; CoordinateAnimation { easing.type: Easing.InOutCirc; duration: 540 } } + Behavior on tilt { DefaultSmoothedAnimation {} } + zoomLevel: 10 + copyrightsVisible: false // customize the default (c) appearance below in MapCopyrightNotice + gesture { + enabled: root.mapInteractive + // effectively disable the rotation gesture + acceptedGestures: MapGestureArea.PanGesture | MapGestureArea.PinchGesture | MapGestureArea.FlickGesture + } + + onErrorChanged: { + console.warn("Map error:", error, errorString) + } + + MapItemView { + autoFitViewport: true + model: root.guidanceMode ? root.model : null + delegate: MapRoute { + route: routeData + line.color: "#798bd9" + line.width: 3 + smooth: true + opacity: NeptuneStyle.fontOpacityHigh + } + } + + MapQuickItem { + id: destMarker + anchorPoint: Qt.point(markerImage.width * 0.5, markerImage.height * 0.8) + coordinate: root.destCoord ? root.destCoord : QtPositioning.coordinate() + visible: root.navigationMode && root.destCoord.isValid + + sourceItem: Image { + id: markerImage + source: Qt.resolvedUrl("../assets/pin-destination.png") + width: 139/2 + height: 161/2 + } + } + + MapQuickItem { + id: posMarker + anchorPoint: Qt.point(posImage.width * 0.5, posImage.height * 0.5) + coordinate: root.routeSegments && root.routeSegments[0] ? root.routeSegments[0].path[0] + : QtPositioning.coordinate() + visible: root.guidanceMode + + sourceItem: Image { + id: posImage + source: Qt.resolvedUrl("../assets/pin-your-position.png") + width: 116/2 + height: 135/2 + } + rotation: root.routeSegments ? root.routeSegments[0].path[0].azimuthTo(root.routeSegments[0].path[1]) + : 0 + } + } + + Image { + id: mask + anchors.fill: mainMap + source: helper.localAsset("bg-home-navigation-overlay", NeptuneStyle.theme) + visible: root.state === "Maximized" + scale: root.state === "Maximized" ? 1 : 1.6 + Behavior on scale { + DefaultNumberAnimation { } + } + } + + MapHeaderPanel { + id: header + anchors.left: parent.left + anchors.right: parent.right + anchors.rightMargin: guidanceMode ? Style.hspan(18) : 0 + anchors.top: parent.top + opacity: root.state !== "Widget1Row" && !offlineMapsEnabled ? 1 : 0 + Behavior on opacity { DefaultNumberAnimation {} } + Behavior on anchors.rightMargin { DefaultNumberAnimation {} } + visible: opacity > 0 + state: root.state + + offlineMapsEnabled: root.offlineMapsEnabled + navigationMode: root.navigationMode + guidanceMode: root.guidanceMode + currentLocation: root.currentLocation + destination: root.destination + routeDistance: root.routeDistance + routeTime: root.routeTime + homeRouteTime: root.homeRouteTime + workRouteTime: root.workRouteTime + + onOpenSearchTextInput: root.openSearchTextInput() + onStartNavigation: { + root.startNavigationRequested(); + root.maximizeMap(); + root.guidanceMode = true; + } + onStopNavigation: { + root.stopNavigationRequested(); + root.navigationMode = false; + root.guidanceMode = false; + } + onShowRoute: { + root.showRouteRequested(destCoord, description); + root.center = destCoord; + root.navigationMode = true; + root.maximizeMap(); + } + } + + NeptuneControls.Tool { + anchors.left: parent.left + anchors.leftMargin: Style.hspan(0.6) + anchors.top: offlineMapsEnabled ? parent.top : header.bottom + anchors.topMargin: Style.vspan(3) + checkable: true + opacity: root.state === "Maximized" ? 1 : 0 + Behavior on opacity { DefaultNumberAnimation {} } + visible: opacity > 0 + background: Image { + fillMode: Image.Pad + source: helper.localAsset("floating-button-bg", NeptuneStyle.theme) + } + symbol: checked ? Qt.resolvedUrl("../assets/ic-3D_ON.png") : Qt.resolvedUrl("../assets/ic-3D_OFF.png") + onClicked: mainMap.tilt = checked ? mainMap.maximumTilt : mainMap.minimumTilt; + } + + MapCopyrightNotice { + anchors.left: mainMap.left + anchors.bottom: mainMap.bottom + anchors.leftMargin: Style.hspan(.5) + mapSource: mainMap + styleSheet: "* { color: '%1'; font-family: '%2'; font-size: %3px}" + .arg(NeptuneStyle.primaryTextColor).arg(NeptuneStyle.fontFamily).arg(NeptuneStyle.fontSizeXXS) + } +} diff --git a/apps/com.pelagicore.qtlocation/panels/MapHeaderPanel.qml b/apps/com.pelagicore.qtlocation/panels/MapHeaderPanel.qml new file mode 100644 index 00000000..7f085bf9 --- /dev/null +++ b/apps/com.pelagicore.qtlocation/panels/MapHeaderPanel.qml @@ -0,0 +1,173 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 +import QtPositioning 5.9 + +import utils 1.0 +import com.pelagicore.styles.neptune 3.0 +import controls 1.0 as NeptuneControls +import animations 1.0 + +Item { + id: root + + height: offlineMapsEnabled ? 0 : headerBackgroundFullscreen.height + + property bool offlineMapsEnabled + property bool navigationMode + property bool guidanceMode + property var currentLocation + + property string destination: "" + property string routeDistance: "" + property string routeTime: "" + property string homeRouteTime: "" + property string workRouteTime: "" + + // TODO make the locations configurable and dynamic + readonly property var homeAddressData: QtPositioning.coordinate(57.706436, 12.018661) + readonly property var workAddressData: QtPositioning.coordinate(57.709545, 11.967005) + + readonly property int destinationButtonrowHeight: 150 + + signal showRoute(var destCoord, string description) + signal startNavigation() + signal stopNavigation() + signal openSearchTextInput() + + Loader { + id: headerBackgroundFullscreen + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.topMargin: Style.vspan(210/80) + active: root.state === "Maximized" + sourceComponent: HeaderBackgroundMaximizedPanel { + navigationMode: root.navigationMode + guidanceMode: root.guidanceMode + destinationButtonrowHeight: root.destinationButtonrowHeight + } + } + + Loader { + id: headerBackgroundWidget + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + active: root.state === "Widget2Rows" || root.state === "Widget3Rows" + sourceComponent: HeaderBackgroundWidgetPanel { + state: root.state + } + } + + Loader { + id: navigationSearchButtonsFullscreen + width: headerBackgroundFullscreen.width - Style.hspan(2) + height: headerBackgroundFullscreen.height + active: headerBackgroundFullscreen.active && !root.navigationMode + anchors.top: headerBackgroundFullscreen.top + anchors.topMargin: Style.vspan(1.4) + anchors.horizontalCenter: headerBackgroundFullscreen.horizontalCenter + sourceComponent: NavigationSearchPanel { + onOpenSearchTextInput: root.openSearchTextInput() + } + } + + Loader { + id: navigationSearchButtonsWidget + width: headerBackgroundWidget.width - (184 * NeptuneStyle.scale) // compensate for the "expand" button in the widget corner + height: headerBackgroundWidget.height + active: headerBackgroundWidget.active + anchors.top: headerBackgroundWidget.top + anchors.topMargin: Style.vspan(.6) + anchors.horizontalCenter: headerBackgroundWidget.horizontalCenter + sourceComponent: NavigationSearchPanel { + onOpenSearchTextInput: root.openSearchTextInput() + } + } + + Loader { + id: navigationConfirmButtons + anchors.fill: headerBackgroundFullscreen + anchors.rightMargin: Style.hspan(.5) + active: headerBackgroundFullscreen.active && root.navigationMode + sourceComponent: NavigationConfirmPanel { + guidanceMode: root.guidanceMode + destination: root.destination + routeDistance: root.routeDistance + routeTime: root.routeTime + onStartNavigation: root.startNavigation() + onStopNavigation: root.stopNavigation() + } + + } + + Loader { + id: favoriteDestinationButtonsFullscreen + anchors.top: headerBackgroundFullscreen.top + anchors.topMargin: headerBackgroundFullscreen.height - height + anchors.left: headerBackgroundFullscreen.left + anchors.leftMargin: Style.hspan(1) + anchors.right: headerBackgroundFullscreen.right + anchors.rightMargin: Style.hspan(1.5) + height: root.destinationButtonrowHeight + active: headerBackgroundFullscreen.active && !root.navigationMode + sourceComponent: FavDestinationButtonsPanel { + homeAddressData: root.homeAddressData + workAddressData: root.workAddressData + homeRouteTime: root.homeRouteTime + workRouteTime: root.workRouteTime + onShowRoute: root.showRoute(destCoord, description); + } + } + + Loader { + id: favoriteDestinationButtonsWidget + anchors.top: headerBackgroundWidget.top + anchors.topMargin: Style.vspan(2) + anchors.left: headerBackgroundWidget.left + anchors.leftMargin: Style.hspan(1) + anchors.right: headerBackgroundWidget.right + anchors.rightMargin: Style.hspan(1.5) + height: root.destinationButtonrowHeight + active: headerBackgroundWidget.active && root.state === "Widget3Rows" + sourceComponent: FavDestinationButtonsPanel { + homeAddressData: root.homeAddressData + workAddressData: root.workAddressData + homeRouteTime: root.homeRouteTime + workRouteTime: root.workRouteTime + onShowRoute: root.showRoute(destCoord, description); + } + } +} diff --git a/apps/com.pelagicore.qtlocation/panels/NavigationConfirmPanel.qml b/apps/com.pelagicore.qtlocation/panels/NavigationConfirmPanel.qml new file mode 100644 index 00000000..6d13a73a --- /dev/null +++ b/apps/com.pelagicore.qtlocation/panels/NavigationConfirmPanel.qml @@ -0,0 +1,123 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 + +import controls 1.0 as NeptuneControls +import utils 1.0 +import com.pelagicore.styles.neptune 3.0 +import "../helpers" + +Row { + id: root + + property bool guidanceMode: false + property string destination: "" + property string routeDistance: "" + property string routeTime: "" + property Helper helper: Helper {} + + signal startNavigation() + signal stopNavigation() + + spacing: Style.hspan(.5) + + NeptuneControls.Tool { + width: Style.hspan(.9) + height: width + visible: root.guidanceMode + symbol: Qt.resolvedUrl("../assets/ic-end-route.png") + onClicked: root.stopNavigation() + } + + RowLayout { + width: root.guidanceMode ? parent.width : parent.width / 2 + anchors.verticalCenter: parent.verticalCenter + spacing: Style.hspan(.7) + + NeptuneControls.Tool { + Layout.leftMargin: parent.spacing + width: Style.hspan(1) + height: width + enabled: visible + visible: !root.guidanceMode + symbol: Style.symbol("ic_back") + onClicked: root.stopNavigation() + } + + Column { + Layout.fillWidth: true + Label { + width: parent.width + wrapMode: Text.WordWrap + font.pixelSize: NeptuneStyle.fontSizeS + text: destination + } + Label { + width: parent.width + wrapMode: Text.WordWrap + font.pixelSize: NeptuneStyle.fontSizeXS + text: "%1 · %2".arg(routeDistance).arg(routeTime) + } + } + } + + Button { + id: startNavigationButton + width: parent.width / 3 + height: Style.vspan(1) + anchors.verticalCenter: parent.verticalCenter + scale: pressed ? 1.1 : 1.0 + visible: !root.guidanceMode + Behavior on scale { NumberAnimation { duration: 50 } } + + contentItem: Item { + Row { + anchors.centerIn: parent + spacing: Style.hspan(0.3) + Image { + anchors.verticalCenter: parent.verticalCenter + fillMode: Image.Pad + source: helper.localAsset("ic-start-navigation", NeptuneStyle.theme) + opacity: startNavigationButton.enabled ? NeptuneStyle.fontOpacityHigh : NeptuneStyle.fontOpacityDisabled + } + Label { + anchors.verticalCenter: parent.verticalCenter + text: qsTr("Start Navigation") + font.pixelSize: NeptuneStyle.fontSizeS + } + } + } + onClicked: root.startNavigation() + } +} diff --git a/apps/com.pelagicore.qtlocation/panels/NavigationSearchPanel.qml b/apps/com.pelagicore.qtlocation/panels/NavigationSearchPanel.qml new file mode 100644 index 00000000..3820f504 --- /dev/null +++ b/apps/com.pelagicore.qtlocation/panels/NavigationSearchPanel.qml @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 + +import controls 1.0 as NeptuneControls +import utils 1.0 +import com.pelagicore.styles.neptune 3.0 +import "../helpers" + +Row { + id: root + + property Helper helper: Helper {} + signal openSearchTextInput() + + spacing: Style.hspan(.5) + + Item { + width: parent.width/2 + height: parent.height + Label { + width: parent.width/2 + wrapMode: Text.WordWrap + maximumLineCount: 2 + elide: Label.ElideRight + font.pixelSize: NeptuneStyle.fontSizeS + text: qsTr("Where do you wanna go today?") + } + } + + Button { + id: searchButton + width: parent.width / 2 + height: Style.vspan(.9) + scale: pressed ? 1.1 : 1.0 + Behavior on scale { NumberAnimation { duration: 50 } } + + contentItem: Item { + Row { + anchors.centerIn: parent + spacing: Style.hspan(0.3) + Image { + anchors.verticalCenter: parent.verticalCenter + fillMode: Image.Pad + source: helper.localAsset("ic-search", NeptuneStyle.theme) + } + Label { + anchors.verticalCenter: parent.verticalCenter + text: qsTr("Search") + font.pixelSize: NeptuneStyle.fontSizeS + } + } + } + onClicked: root.openSearchTextInput() + } +} diff --git a/apps/com.pelagicore.qtlocation/panels/SearchOverlayPanel.qml b/apps/com.pelagicore.qtlocation/panels/SearchOverlayPanel.qml new file mode 100644 index 00000000..bb171f07 --- /dev/null +++ b/apps/com.pelagicore.qtlocation/panels/SearchOverlayPanel.qml @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 +import QtLocation 5.9 + +import controls 1.0 +import utils 1.0 +import com.pelagicore.styles.neptune 3.0 + +import "../helpers" +import "../controls" + +ColumnLayout { + id: root + + property GeocodeModel model + + spacing: Style.vspan(1) + + signal backButtonClicked() + signal searchFieldAccepted() + signal escapePressed() + signal searchQueryChanged(var searchQuery) + signal itemClicked(var index, string addressText, var coordinate, var boundingBox) + + Tool { + anchors.left: parent.left + anchors.leftMargin: Style.hspan(1) + symbol: Style.symbol("ic_back") + text: qsTr("Back") + onClicked: root.backButtonClicked() + } + + MapSearchTextField { + id: searchField + anchors.left: parent.left + anchors.leftMargin: Style.hspan(2) + anchors.right: parent.right + anchors.rightMargin: Style.hspan(2) + selectByMouse: true + focus: root.visible + busy: root.model.status === GeocodeModel.Loading + onTextChanged: { + if (searchField.text.length > 1) { + searchTimer.restart(); + } else { + searchTimer.stop(); + } + } + onAccepted: root.searchFieldAccepted() + Keys.onEscapePressed: root.escapePressed() + } + + ListView { + id: searchResultsList + Layout.fillHeight: true + anchors.left: parent.left + anchors.leftMargin: Style.hspan(2) + anchors.right: parent.right + anchors.rightMargin: Style.hspan(2) + clip: true + visible: root.visible + model: root.model + delegate: ListItem { + id: itemDelegate + width: parent.width + height: Style.vspan(1.5) + readonly property string addressText: locationData.address.text + readonly property string city: locationData.address.city + readonly property string country: locationData.address.country + text: addressText + subText: itemDelegate.city !== "" ? itemDelegate.city + ", " + itemDelegate.country : itemDelegate.country; + onClicked: { + root.itemClicked(index, itemDelegate.addressText, locationData.coordinate, locationData.boundingBox) + } + } + ScrollIndicator.vertical: ScrollIndicator {} + } + + Timer { + id: searchTimer + interval: 500 + onTriggered: { + root.searchQueryChanged(searchField.text) + } + } +} diff --git a/apps/com.pelagicore.qtlocation/run-standalone.sh b/apps/com.pelagicore.qtlocation/run-standalone.sh deleted file mode 100755 index 236674bc..00000000 --- a/apps/com.pelagicore.qtlocation/run-standalone.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -SERVER_CONF_PATH=/opt/neptune3/server.conf QT_PLUGIN_PATH=/opt/neptune3:$QT_PLUGIN_PATH QT_QUICK_CONTROLS_CONF=/opt/neptune3/styles/1080x1920Neptune.conf QT_QUICK_CONTROLS_STYLE_PATH=/opt/neptune3/styles/ QT_QUICK_CONTROLS_STYLE=neptune qmlscene StandAlone.qml -I /opt/neptune3/imports/shared/ diff --git a/apps/com.pelagicore.qtlocation/stores/MapStore.qml b/apps/com.pelagicore.qtlocation/stores/MapStore.qml new file mode 100644 index 00000000..90cee085 --- /dev/null +++ b/apps/com.pelagicore.qtlocation/stores/MapStore.qml @@ -0,0 +1,135 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Pelagicore AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtPositioning 5.9 +import QtLocation 5.9 + +QtObject { + id: root + + readonly property bool calculating: routeModel.status === RouteModel.Loading + readonly property alias model: routeModel + property string routeDistance + property string routeTime + property var routeSegments + property string homeRouteTime + property string workRouteTime + + property alias routingPlugin: routeModel.plugin + property var currentLocationCoord + property var homeCoord + property var workCoord + + property var startCoord: QtPositioning.coordinate() + property var destCoord: QtPositioning.coordinate() + + property string destination + + function formatMeters(meters) { + return qsTr("%n kilometer(s)", "", meters/1000) + } + + function formatSeconds(seconds) { + const numdays = Math.floor((seconds % 31536000) / 86400) + const numhours = Math.floor(((seconds % 31536000) % 86400) / 3600) + const numminutes = Math.ceil((((seconds % 31536000) % 86400) % 3600) / 60) + + var result = ""; + if (numdays > 0) + result += qsTr("%n day(s)", "", numdays) + ", "; + if (numhours > 0) + result += qsTr("%n hour(s)", "", numhours) + ", "; + if (numminutes > 0) + result += qsTr("%n minute(s)", "", numminutes); + + return result; + } + + readonly property RouteModel routeModel: RouteModel { + id: routeModel + autoUpdate: !!root.startCoord && !!root.destCoord + query: RouteQuery { + waypoints: [root.startCoord, root.destCoord] + } + onStatusChanged: { + if (status === RouteModel.Null) { + console.info("Route model idle"); + } else if (status === RouteModel.Ready) { + console.info("Route model ready, results:", count) + if (count > 0) { + root.routeDistance = formatMeters(get(0).distance); + root.routeTime = formatSeconds(get(0).travelTime); + root.routeSegments = get(0).segments; + console.info("Route distance (km):", root.routeDistance, ", time:", root.routeTime); + console.info("First coord:", root.routeSegments[0].path[0]) + } + } else if (status === RouteModel.Loading) { + console.info("Route model busy"); + } else if (status === RouteModel.Error) { + console.warn("Route model error:", error, errorString); + } + } + } + + readonly property RouteModel homeRouteModel: RouteModel { + autoUpdate: !!root.currentLocationCoord && !!root.homeCoord + query: RouteQuery { + waypoints: [root.currentLocationCoord, root.homeCoord] + } + plugin: Plugin { name: "osm" } + + onStatusChanged: { + if (status === RouteModel.Ready) { + if (count > 0) { + root.homeRouteTime = formatSeconds(get(0).travelTime); + console.info("Home route distance (km):", formatMeters(get(0).distance), ", time:", root.homeRouteTime) + } + } + } + } + + readonly property RouteModel workRouteModel: RouteModel { + autoUpdate: !!root.currentLocationCoord && !!root.workCoord + query: RouteQuery { + waypoints: [root.currentLocationCoord, root.workCoord] + } + plugin: Plugin { name: "osm" } + onStatusChanged: { + if (status === RouteModel.Ready) { + if (count > 0) { + root.workRouteTime = formatSeconds(get(0).travelTime); + console.info("Work route distance (km):", formatMeters(get(0).distance), ", time:", root.workRouteTime) + } + } + } + } +} diff --git a/apps/com.pelagicore.qtlocation/views/MapView.qml b/apps/com.pelagicore.qtlocation/views/MapView.qml new file mode 100644 index 00000000..e07ab71c --- /dev/null +++ b/apps/com.pelagicore.qtlocation/views/MapView.qml @@ -0,0 +1,300 @@ +/**************************************************************************** +** +** Copyright (C) 2017-2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 IVI UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 +import QtPositioning 5.9 +import QtLocation 5.9 +import QtGraphicalEffects 1.0 + +import Qt.labs.platform 1.0 + +import utils 1.0 +import controls 1.0 as NeptuneControls +import animations 1.0 + +import com.pelagicore.styles.neptune 3.0 + +import "../controls" +import "../panels" +import "../stores" +import "../helpers" + +Item { + id: root + + property bool offlineMapsEnabled + onOfflineMapsEnabledChanged: getAvailableMapsAndLocation() + + property MapStore store + + // props for secondary window + property alias mapInteractive: mapBoxView.mapInteractive + property alias mapCenter: mapBoxView.center + property alias mapZoomLevel: mapBoxView.zoomLevel + property alias mapTilt: mapBoxView.tilt + property alias mapBearing: mapBoxView.bearing + readonly property alias mapReady: mapBoxView.mapReady + readonly property alias currentLocation: priv.positionCoordinate + + property bool searchViewEnabled: false + property Helper helper: Helper {} + + signal maximizeMap() + + Component.onCompleted: { + root.store.homeCoord = mapBoxView.mapHeader.homeAddressData; + root.store.workCoord = mapBoxView.mapHeader.workAddressData; + } + + onStateChanged: root.searchViewEnabled = false; + + function fetchCurrentLocation() { // PositionSource doesn't work on Linux + var req = new XMLHttpRequest; + req.onreadystatechange = function() { + if (req.readyState === XMLHttpRequest.DONE) { + var objectArray = JSON.parse(req.responseText); + if (objectArray.errors !== undefined) { + console.warn("Error fetching location:", objectArray.errors[0].message); + } else { + priv.positionCoordinate = QtPositioning.coordinate(objectArray.location.lat, objectArray.location.lng); + console.info("Current location:", priv.positionCoordinate); + } + } + } + req.open("GET", "https://location.services.mozilla.com/v1/geolocate?key=geoclue"); + req.send(); + } + + function getAvailableMapsAndLocation() { + if (mapBoxView.mapReady) { + mapTypeModel.clear(); + console.info("Supported map types:"); + for (var i = 0; i < mapBoxView.supportedMapTypes.length; i++) { + var map = mapBoxView.supportedMapTypes[i]; + mapTypeModel.append({"name": map.name, "data": map}) // fill the map type model + console.info("\t", map.name, ", description:", map.description, ", style:", map.style, ", night mode:", map.night); + } + if (!root.offlineMapsEnabled) { + fetchCurrentLocation(); + } + } + } + + function getMapType(name) { + if (!mapBoxView.mapReady || !mapTypeModel.count) { + return + } + for (var i = 0; i < mapTypeModel.count; i++) { + var map = mapTypeModel.get(i); + if (map && map.name === name) { + return map.data; + } + } + } + + QtObject { + id: priv + readonly property var plugins: ["mapboxgl", "osm"] + property var positionCoordinate: offlineMapsEnabled ? QtPositioning.coordinate(57.709912, 11.966632) // Gothenburg + : QtPositioning.coordinate(49.5938686, 17.2508706) // Olomouc + property var originalPosition: positionCoordinate + readonly property string defaultLightThemeId: "mapbox://styles/qtauto/cjcm1by3q12dk2sqnquu0gju9" + readonly property string defaultDarkThemeId: "mapbox://styles/qtauto/cjcm1czb812co2sno1ypmp1r8" + } + + ListModel { + // lists the various map styles (including the custom ones); filled in Map.onMapReadyChanged + id: mapTypeModel + } + + Plugin { + id: mapPlugin + locales: Style.languageLocale + preferred: priv.plugins + + readonly property string cacheDirUrl: StandardPaths.writableLocation(StandardPaths.CacheLocation); + + // Mapbox Plugin Parameters + PluginParameter { + name: "mapboxgl.access_token" + value: "pk.eyJ1IjoicXRhdXRvIiwiYSI6ImNqY20wbDZidzBvcTQyd3J3NDlkZ21jdjUifQ.4KYDlP7UmQEVPYffr6VuVQ" + } + PluginParameter { + name: "mapboxgl.mapping.additional_style_urls" + value: [priv.defaultLightThemeId, priv.defaultDarkThemeId].join(",") + } + + // OSM Plugin Parameters + PluginParameter { name: "osm.useragent"; value: "Neptune UI" } + + // Offline maps support + PluginParameter { name: "mapboxgl.mapping.cache.directory"; + // needs to be an absolute filepath so strip the file:/// protocol; several leading slashes don't matter + value: mapPlugin.cacheDirUrl.toString().substring(mapPlugin.cacheDirUrl.indexOf(':')+1) } + } + + // This is needed since MapBox plugin does not support geocoding yet. TODO: find a better way to support geocoding. + Plugin { + id: geocodePlugin + name: "osm" + locales: Style.languageLocale + + // OSM Plugin Parameters + PluginParameter { name: "osm.useragent"; value: "Neptune UI" } + } + + GeocodeModel { + id: geocodeModel + plugin: geocodePlugin + limit: 20 + } + + MapBoxPanel { + id: mapBoxView + anchors.fill: parent + plugin: mapPlugin + center: priv.positionCoordinate + state: root.state + currentLocation: priv.positionCoordinate + offlineMapsEnabled: root.offlineMapsEnabled + destination: root.store.destination + model: root.store.model + routeDistance: root.store.routeDistance + routeTime: root.store.routeTime + routeSegments: root.store.routeSegments + homeRouteTime: root.store.homeRouteTime + workRouteTime: root.store.workRouteTime + destCoord: root.store.destCoord + + activeMapType: { + if (!mapReady || plugin.name !== "mapboxgl") { + return supportedMapTypes[0]; + } + return NeptuneStyle.theme === NeptuneStyle.Light ? getMapType(priv.defaultLightThemeId) : getMapType(priv.defaultDarkThemeId); + } + onOpenSearchTextInput: { + root.maximizeMap(); + searchViewEnabled = true; + } + onStartNavigationRequested: { + priv.originalPosition = priv.positionCoordinate; + } + onShowRouteRequested: { + priv.originalPosition = priv.positionCoordinate; + root.store.destCoord = destCoord; + root.store.destination = description; + root.store.startCoord = mapBoxView.currentLocation; + } + onStopNavigationRequested: { + priv.positionCoordinate = priv.originalPosition; + mapBoxView.center = priv.positionCoordinate; + } + + onMapReadyChanged: getAvailableMapsAndLocation(); + onMaximizeMap: root.maximizeMap(); + Component.onCompleted: { + root.store.routingPlugin = geocodePlugin + } + } + + NeptuneControls.Tool { + anchors.left: parent.left + anchors.leftMargin: Style.hspan(0.6) + anchors.top: parent.top + anchors.topMargin: Style.vspan(0.6) + opacity: root.state === "Widget1Row" ? 1 : 0 + Behavior on opacity { DefaultNumberAnimation {} } + visible: opacity > 0 + symbol: Qt.resolvedUrl("../assets/ic-search.png") + background: Image { + fillMode: Image.Pad + source: helper.localAsset("floating-button-bg", NeptuneStyle.theme) + } + onClicked: root.maximizeMap() + } + + FastBlur { + anchors.fill: mapBoxView + source: mapBoxView + radius: 64 + visible: searchViewEnabled + } + + BorderImage { + id: overlay + anchors.fill: root + border.top: 322 + border.bottom: 323 + border.left: 0 + border.right: 0 + source: Style.gfx2("input-overlay") + visible: searchViewEnabled + } + + SearchOverlayPanel { + id: searchOverlay + anchors.fill: root + anchors.topMargin: Style.vspan(1) + visible: searchViewEnabled + spacing: Style.vspan(1) + model: geocodeModel + + onBackButtonClicked: searchViewEnabled = false + + onSearchFieldAccepted: { + geocodeModel.query = searchOverlay.searchQuery; + geocodeModel.update(); + searchViewEnabled = false; + } + + onSearchQueryChanged: { + geocodeModel.reset(); + geocodeModel.query = searchQuery; + geocodeModel.update(); + } + + onEscapePressed: searchViewEnabled = false + + onItemClicked: { + searchViewEnabled = false; + mapBoxView.center = coordinate; + root.store.startCoord = priv.positionCoordinate; + root.store.destCoord = coordinate; + root.store.destination = addressText; + if (boundingBox.isValid) { + mapBoxView.visibleRegion = boundingBox; + } + mapBoxView.navigationMode = true; + } + } +} diff --git a/imports/assets/translations/cs_CZ.ts b/imports/assets/translations/cs_CZ.ts index 0a0fc739..852c8489 100644 --- a/imports/assets/translations/cs_CZ.ts +++ b/imports/assets/translations/cs_CZ.ts @@ -365,15 +365,26 @@ UX na cestu Faiss Dr, Las Vegas + + FavDestinationButtonsPanel + + Home + Domů + + + Work + Práce + + FavoriteDestinationButtons Home - Domů + Domů Work - Práce + Práce @@ -538,7 +549,42 @@ UX na cestu MapRouting %n kilometer(s) - + + %n kilometr + %n kilometry + %n kilometrů + + + + %n day(s) + + %n den + %n dny + %n dnů + + + + %n hour(s) + + %n hodina + %n hodiny + %n hodin + + + + %n minute(s) + + %n minuta + %n minuty + %n minut + + + + + MapStore + + %n kilometer(s) + %n kilometr %n kilometry %n kilometrů @@ -546,7 +592,7 @@ UX na cestu %n day(s) - + %n den %n dny %n dnů @@ -554,7 +600,7 @@ UX na cestu %n hour(s) - + %n hodina %n hodiny %n hodin @@ -562,7 +608,7 @@ UX na cestu %n minute(s) - + %n minuta %n minuty %n minut @@ -598,10 +644,6 @@ UX na cestu Where do you wanna go today? Kam se chcete vydat dnes? - - Back - - MonitorView @@ -766,18 +808,36 @@ UX na cestu NavigationConfirm Start Navigation - Spustit navigaci + Spustit navigaci + + + + NavigationConfirmPanel + + Start Navigation + Spustit navigaci NavigationSearch Where do you wanna go today? - Kam se chcete vydat dnes? + Kam se chcete vydat dnes? + + + Search + Hledat + + + + NavigationSearchPanel + + Where do you wanna go today? + Kam se chcete vydat dnes? Search - Hledat + Hledat @@ -900,6 +960,13 @@ UX na cestu Tmavý + + SearchOverlayPanel + + Back + + + SettingsModel diff --git a/imports/assets/translations/de_DE.ts b/imports/assets/translations/de_DE.ts index 52dbc59e..5289c957 100644 --- a/imports/assets/translations/de_DE.ts +++ b/imports/assets/translations/de_DE.ts @@ -309,7 +309,7 @@ UX to the road - FavoriteDestinationButtons + FavDestinationButtonsPanel Home @@ -420,7 +420,7 @@ UX to the road - MapRouting + MapStore %n kilometer(s) @@ -463,10 +463,6 @@ UX to the road Where do you wanna go today? Wo soll es heute hingehen? - - Back - - MonitorView @@ -581,7 +577,7 @@ UX to the road - NavigationConfirm + NavigationConfirmPanel Start Navigation @@ -589,6 +585,13 @@ UX to the road NavigationSearch + + Where do you wanna go today? + Wo soll es heute hingehen? + + + + NavigationSearchPanel Where do you wanna go today? Wo soll es heute hingehen? @@ -676,6 +679,13 @@ UX to the road Dunkel + + SearchOverlayPanel + + Back + + + SettingsModel diff --git a/imports/assets/translations/en_GB.ts b/imports/assets/translations/en_GB.ts index 62d81b36..ec95cd18 100644 --- a/imports/assets/translations/en_GB.ts +++ b/imports/assets/translations/en_GB.ts @@ -213,7 +213,7 @@ UX to the road - FavoriteDestinationButtons + FavDestinationButtonsPanel Home @@ -282,38 +282,62 @@ UX to the road MapRouting %n kilometer(s) - + %n kilometer %n kilometers %n day(s) - + %n day %n days %n hour(s) - + %n hour %n hours %n minute(s) - + %n minute %n minutes - Maps - - Back - + MapStore + + %n kilometer(s) + + %n kilometer + %n kilometers + + + + %n day(s) + + %n day + %n days + + + + %n hour(s) + + %n hour + %n hours + + + + %n minute(s) + + %n minute + %n minutes + @@ -380,14 +404,14 @@ UX to the road - NavigationConfirm + NavigationConfirmPanel Start Navigation - NavigationSearch + NavigationSearchPanel Where do you wanna go today? @@ -475,6 +499,13 @@ UX to the road + + SearchOverlayPanel + + Back + + + SettingsModel diff --git a/imports/assets/translations/en_US.ts b/imports/assets/translations/en_US.ts index 72ec78ec..e8653dd2 100644 --- a/imports/assets/translations/en_US.ts +++ b/imports/assets/translations/en_US.ts @@ -213,7 +213,7 @@ UX to the road - FavoriteDestinationButtons + FavDestinationButtonsPanel Home @@ -282,38 +282,62 @@ UX to the road MapRouting %n kilometer(s) - + %n kilometer %n kilometers %n day(s) - + %n day %n days %n hour(s) - + %n hour %n hours %n minute(s) - + %n minute %n minutes - Maps - - Back - + MapStore + + %n kilometer(s) + + %n kilometer + %n kilometers + + + + %n day(s) + + %n day + %n days + + + + %n hour(s) + + %n hour + %n hours + + + + %n minute(s) + + %n minute + %n minutes + @@ -373,14 +397,14 @@ UX to the road - NavigationConfirm + NavigationConfirmPanel Start Navigation - NavigationSearch + NavigationSearchPanel Where do you wanna go today? @@ -468,6 +492,13 @@ UX to the road + + SearchOverlayPanel + + Back + + + SettingsModel diff --git a/imports/assets/translations/ja_JP.ts b/imports/assets/translations/ja_JP.ts index b31d3061..f5b45faa 100644 --- a/imports/assets/translations/ja_JP.ts +++ b/imports/assets/translations/ja_JP.ts @@ -294,15 +294,26 @@ UX to the road Faiss Dr, Las Vegas + + FavDestinationButtonsPanel + + Home + ホーム + + + Work + 作業 + + FavoriteDestinationButtons Home - ホーム + ホーム Work - 作業 + 作業 @@ -432,25 +443,52 @@ UX to the road MapRouting %n kilometer(s) - + + %nキロメートル + + + + %n day(s) + + %n日 + + + + %n hour(s) + + %n時間 + + + + %n minute(s) + + %n分 + + + + + MapStore + + %n kilometer(s) + %nキロメートル %n day(s) - + %n日 %n hour(s) - + %n時間 %n minute(s) - + %n分 @@ -468,10 +506,6 @@ UX to the road Where do you wanna go today? あなたはヒンジを握っていますか? - - Back - - MonitorView @@ -620,18 +654,36 @@ UX to the road NavigationConfirm Start Navigation - ナビゲーションを開始する + ナビゲーションを開始する + + + + NavigationConfirmPanel + + Start Navigation + ナビゲーションを開始する NavigationSearch Where do you wanna go today? - あなたはヒンジを握っていますか? + あなたはヒンジを握っていますか? Search - 探す + 探す + + + + NavigationSearchPanel + + Where do you wanna go today? + あなたはヒンジを握っていますか? + + + Search + 探す @@ -731,6 +783,13 @@ UX to the road ダーク + + SearchOverlayPanel + + Back + + + SettingsModel diff --git a/imports/assets/translations/ko_KR.ts b/imports/assets/translations/ko_KR.ts index f5be3c59..95880da8 100644 --- a/imports/assets/translations/ko_KR.ts +++ b/imports/assets/translations/ko_KR.ts @@ -301,15 +301,26 @@ UX to the road Faiss Dr, Las Vegas + + FavDestinationButtonsPanel + + Home + + + + Work + 작업 + + FavoriteDestinationButtons Home - + Work - 작업 + 작업 @@ -439,25 +450,52 @@ UX to the road MapRouting %n kilometer(s) - + + %n 킬로미터 + + + + %n day(s) + + %n 일 + + + + %n hour(s) + + %n 시간 + + + + %n minute(s) + + %n 분 + + + + + MapStore + + %n kilometer(s) + %n 킬로미터 %n day(s) - + %n 일 %n hour(s) - + %n 시간 %n minute(s) - + %n 분 @@ -475,10 +513,6 @@ UX to the road Where do you wanna go today? 힌트 힌지를 해결 하시겠습니까? - - Back - - MonitorView @@ -627,18 +661,36 @@ UX to the road NavigationConfirm Start Navigation - 내비게이션 시작 + 내비게이션 시작 + + + + NavigationConfirmPanel + + Start Navigation + 내비게이션 시작 NavigationSearch Where do you wanna go today? - 힌트 힌지를 해결 하시겠습니까? + 힌트 힌지를 해결 하시겠습니까? Search - 발견 + 발견 + + + + NavigationSearchPanel + + Where do you wanna go today? + 힌트 힌지를 해결 하시겠습니까? + + + Search + 발견 @@ -738,6 +790,13 @@ UX to the road 어둡게 + + SearchOverlayPanel + + Back + + + SettingsModel diff --git a/imports/assets/translations/zh_CN.ts b/imports/assets/translations/zh_CN.ts index a7bda2f2..5b2d31c0 100644 --- a/imports/assets/translations/zh_CN.ts +++ b/imports/assets/translations/zh_CN.ts @@ -301,15 +301,26 @@ UX to the road Faiss Dr, 拉斯维加斯 + + FavDestinationButtonsPanel + + Home + + + + Work + 工作 + + FavoriteDestinationButtons Home - + Work - 工作 + 工作 @@ -460,25 +471,52 @@ If it is wrong, you can just delete first two charactor, just ues "源" MapRouting %n kilometer(s) - + + %n公里 + + + + %n day(s) + + %n天 + + + + %n hour(s) + + %n小时 + + + + %n minute(s) + + %n分钟 + + + + + MapStore + + %n kilometer(s) + %n公里 %n day(s) - + %n天 %n hour(s) - + %n小时 %n minute(s) - + %n分钟 @@ -496,10 +534,6 @@ If it is wrong, you can just delete first two charactor, just ues "源" Where do you wanna go today? 今天你想要去哪儿? - - Back - - MonitorView @@ -652,18 +686,36 @@ If it is wrong, you can just delete first two charactor, just ues "源" NavigationConfirm Start Navigation - 开始导航 + 开始导航 + + + + NavigationConfirmPanel + + Start Navigation + 开始导航 NavigationSearch Where do you wanna go today? - 今天你想要去哪儿? + 今天你想要去哪儿? Search - 搜索 + 搜索 + + + + NavigationSearchPanel + + Where do you wanna go today? + 今天你想要去哪儿? + + + Search + 搜索 @@ -778,6 +830,13 @@ If it is wrong, you can just delete first two charactor, just ues "源" 深色 + + SearchOverlayPanel + + Back + + + SettingsModel diff --git a/imports/shared/utils/Style.qml b/imports/shared/utils/Style.qml index 0bcb08cc..ec5bf44b 100644 --- a/imports/shared/utils/Style.qml +++ b/imports/shared/utils/Style.qml @@ -88,11 +88,6 @@ QtObject { return gfxUrl + name + themeStr + '.png' } - function localAsset(asset, theme) { - var themeStr = theme === NeptuneStyle.Dark ? "-dark" : ""; - return "assets/" + asset + themeStr + '.png' - } - function icon(name) { return drawableUrl + '/' + name + '.png'; } -- cgit v1.2.3