summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViktor Verebelyi <vviktor2@gmail.com>2020-11-05 03:30:13 +0000
committerViktor Verebelyi <vviktor2@gmail.com>2020-11-05 03:30:13 +0000
commit258d82154d977b6202efa45c24f1f4c7a73b5588 (patch)
tree86bbd3f8aed6b7b90f908035facd5ac8a0cecb14
parent24e33f4c9195ceab6696bf37d347ce2f1d9cc3ec (diff)
downloadnavit-258d82154d977b6202efa45c24f1f4c7a73b5588.tar.gz
add:qt5_gui:Levy Add OSD items to QML UI
-rw-r--r--navit/gui/qt5_qml/gui_qt5_qml.qrc3
-rw-r--r--navit/gui/qt5_qml/navitroute.cpp189
-rw-r--r--navit/gui/qt5_qml/navitroute.h52
-rw-r--r--navit/gui/qt5_qml/themes/Levy/DestinationDetailsBar.qml123
-rw-r--r--navit/gui/qt5_qml/themes/Levy/Instructions.qml73
-rw-r--r--navit/gui/qt5_qml/themes/Levy/MainLayout.qml98
-rw-r--r--navit/gui/qt5_qml/themes/Levy/RouteCalculating.qml26
-rw-r--r--navit/gui/qt5_qml/themes/Levy/SpeedGauge.qml111
8 files changed, 510 insertions, 165 deletions
diff --git a/navit/gui/qt5_qml/gui_qt5_qml.qrc b/navit/gui/qt5_qml/gui_qt5_qml.qrc
index 87795a0bb..179a29e27 100644
--- a/navit/gui/qt5_qml/gui_qt5_qml.qrc
+++ b/navit/gui/qt5_qml/gui_qt5_qml.qrc
@@ -951,6 +951,7 @@
<file>themes/Levy/SearchDrawerContextMenu.qml</file>
<file>themes/Levy/SearchDrawerBreadcrumbs.qml</file>
<file>themes/Levy/DestinationDetailsBar.qml</file>
- <file>themes/Levy/RouteCalculating.qml</file>
+ <file>themes/Levy/SpeedGauge.qml</file>
+ <file>themes/Levy/Instructions.qml</file>
</qresource>
</RCC>
diff --git a/navit/gui/qt5_qml/navitroute.cpp b/navit/gui/qt5_qml/navitroute.cpp
index 7661be54c..b7c8febe0 100644
--- a/navit/gui/qt5_qml/navitroute.cpp
+++ b/navit/gui/qt5_qml/navitroute.cpp
@@ -51,7 +51,6 @@ void NavitRoute::setNavit(NavitInstance * navit){
navit_add_callback(m_navitInstance->getNavit(),cb);
navit_add_callback(m_navitInstance->getNavit(),cb2);
-
struct attr route_attr;
if (navit_get_attr(m_navitInstance->getNavit(),attr_route,&route_attr,nullptr)) {
@@ -61,7 +60,28 @@ void NavitRoute::setNavit(NavitInstance * navit){
route_add_attr(route_attr.u.route, &callback);
}
- statusUpdate();
+ routeUpdate();
+}
+
+void NavitRoute::updateNextTurn(struct map * map){
+ struct map_rect * mr = nullptr;
+ struct item * item = nullptr;
+
+ if(map)
+ mr = map_rect_new(map,nullptr);
+ if(mr) {
+ while ((item = map_rect_get_item(mr))
+ && (item->type == type_nav_position || item->type == type_nav_none/* || level-- > 0*/));
+ if (item) {
+ QString url = QString("%1_bk.svg").arg(graphics_icon_path(item_to_name(item->type)));
+ QUrl nextTurnIcon = QUrl::fromLocalFile(url);
+ if(nextTurnIcon != m_nextTurnIcon){
+ m_nextTurnIcon = nextTurnIcon;
+ emit nextTurnChanged();
+ }
+ }
+ }
+ map_rect_destroy(mr);
}
void NavitRoute::routeUpdate(){
@@ -70,6 +90,7 @@ void NavitRoute::routeUpdate(){
struct navigation * nav = nullptr;
struct attr attr,route;
struct item * item = nullptr;
+ struct item * item2 = nullptr;
nav = navit_get_navigation(m_navitInstance->getNavit());
if(!nav) {
@@ -79,49 +100,128 @@ void NavitRoute::routeUpdate(){
if(map)
mr = map_rect_new(map,nullptr);
if(mr) {
- if (navit_get_attr(m_navitInstance->getNavit(), attr_route, &route, nullptr)) {
- struct attr destination_length, destination_time;
- char *distance=nullptr,*timeLeft=nullptr;
- if (route_get_attr(route.u.route, attr_destination_length, &destination_length, nullptr))
- distance=attr_to_text_ext(&destination_length, nullptr, attr_format_with_units, attr_format_default, nullptr);
- if (route_get_attr(route.u.route, attr_destination_time, &destination_time, nullptr))
- timeLeft=attr_to_text_ext(&destination_time, nullptr, attr_format_with_units, attr_format_default, nullptr);
- QStringList timeLeftArr = QString(timeLeft).split(":");
- QDateTime dt = QDateTime::currentDateTime();
- QTime time;
-
- switch (timeLeftArr.size()) {
- case 4:
- dt = dt.addDays(timeLeftArr[0].toInt());
- time.setHMS(timeLeftArr[1].toInt(),timeLeftArr[2].toInt(),timeLeftArr[3].toInt());
- break;
- case 3:
- time.setHMS(timeLeftArr[0].toInt(),timeLeftArr[1].toInt(),timeLeftArr[2].toInt());
- break;
- case 2:
- time.setHMS(0,timeLeftArr[0].toInt(),timeLeftArr[1].toInt());
- break;
- case 1:
- time.setHMS(0,0,timeLeftArr[0].toInt());
- break;
- }
-
- dt = dt.addMSecs(time.msecsSinceStartOfDay());
-
- m_distance = distance;
- m_timeLeft = timeLeft;
- m_arrivalTime = dt.toString("hh:mm");
- }
-
m_directions.clear();
while((item = map_rect_get_item(mr))) {
if(item_attr_get(item,attr_navigation_long,&attr)) {
m_directions << map_convert_string_tmp(item->map,attr.u.str);
}
}
- emit propertiesChanged();
}
+
map_rect_destroy(mr);
+ if(map)
+ mr = map_rect_new(map,nullptr);
+ if(mr) {
+ map_rect_get_item(mr);
+ if((item2 = map_rect_get_item(mr))){
+ struct attr length_attr, street_attr;
+ if(item_attr_get(item2,attr_length,&length_attr)) {
+ m_nextTurnDistance = QString("%1 meters").arg(length_attr.u.num);
+ }
+
+ QString streetname;
+ if(item_attr_get(item2,attr_street_name,&street_attr)) {
+ streetname = street_attr.u.str;
+ }
+ if(item_attr_get(item2,attr_street_name_systematic,&street_attr)) {
+ if(streetname.isEmpty())
+ streetname = street_attr.u.str;
+ else
+ streetname.append(QString(" (%1)").arg(street_attr.u.str));
+ }
+ m_nextTurn = streetname;
+
+ emit nextTurnChanged();
+ }
+
+ }
+ map_rect_destroy(mr);
+
+ if (navit_get_attr(m_navitInstance->getNavit(), attr_route, &route, nullptr)) {
+ struct attr destination_length, destination_time;
+ char *distance=nullptr,*timeLeft=nullptr;
+
+ if (route_get_attr(route.u.route, attr_destination_length, &destination_length, nullptr)){
+ distance=attr_to_text_ext(&destination_length, nullptr, attr_format_with_units, attr_format_default, nullptr);
+ }
+
+ if (route_get_attr(route.u.route, attr_destination_time, &destination_time, nullptr)){
+ timeLeft=attr_to_text_ext(&destination_time, nullptr, attr_format_with_units, attr_format_default, nullptr);
+ }
+
+ QStringList timeLeftArr = QString(timeLeft).split(":");
+ QDateTime dt = QDateTime::currentDateTime();
+ QTime time;
+
+ switch (timeLeftArr.size()) {
+ case 4:
+ dt = dt.addDays(timeLeftArr[0].toInt());
+ time.setHMS(timeLeftArr[1].toInt(),timeLeftArr[2].toInt(),timeLeftArr[3].toInt());
+ break;
+ case 3:
+ time.setHMS(timeLeftArr[0].toInt(),timeLeftArr[1].toInt(),timeLeftArr[2].toInt());
+ break;
+ case 2:
+ time.setHMS(0,timeLeftArr[0].toInt(),timeLeftArr[1].toInt());
+ break;
+ case 1:
+ time.setHMS(0,0,timeLeftArr[0].toInt());
+ break;
+ }
+
+ dt = dt.addMSecs(time.msecsSinceStartOfDay());
+
+ m_distance = distance;
+ m_timeLeft = timeLeft;
+ m_arrivalTime = dt.toString("hh:mm");
+ }
+
+ struct attr vehicle,speed_attr;
+
+ int speed = -1;
+ if (navit_get_attr(m_navitInstance->getNavit(), attr_vehicle, &vehicle, nullptr)) {
+ vehicle_get_attr(vehicle.u.vehicle,attr_position_speed, &speed_attr, nullptr);
+ speed = *(speed_attr.u.numd);
+ }
+ m_speed = speed;
+
+ struct attr maxspeed_attr, street_name_attr;
+ struct tracking *tracking;
+ int routespeed = -1;
+ tracking = navit_get_tracking(m_navitInstance->getNavit());
+
+ if (tracking) {
+
+ if (tracking_get_attr(tracking, attr_maxspeed, &maxspeed_attr, nullptr)) {
+ routespeed = maxspeed_attr.u.num;
+ }
+ if (routespeed == -1) {
+ struct vehicleprofile *prof=navit_get_vehicleprofile(m_navitInstance->getNavit());
+ struct roadprofile *rprof=nullptr;
+ if (prof && item)
+ rprof=vehicleprofile_get_roadprofile(prof, item->type);
+ if (rprof) {
+ if(rprof->maxspeed!=0)
+ routespeed=rprof->maxspeed;
+ }
+ }
+ QString streetname;
+ if (tracking_get_attr(tracking, attr_street_name, &street_name_attr, nullptr)) {
+ streetname = street_name_attr.u.str;
+ }
+ if (tracking_get_attr(tracking, attr_street_name_systematic, &street_name_attr, nullptr)) {
+ if(streetname.isEmpty())
+ streetname = street_name_attr.u.str;
+ else
+ streetname.append(QString(" (%1)").arg(street_name_attr.u.str));
+ }
+ m_currentStreet = streetname;
+ }
+ m_speedLimit = routespeed;
+ emit propertiesChanged();
+
+ updateNextTurn(map);
+ statusUpdate();
}
QString NavitRoute::getLastDestination(struct pcoord *pc) {
@@ -186,11 +286,14 @@ void NavitRoute::statusUpdate(){
return;
}
struct attr attr;
- navigation_get_attr(nav, attr_nav_status, &attr,nullptr);
- if(m_status != attr.u.num){
- m_status = static_cast<Status>(attr.u.num);
- qDebug() << "status : " << nav_status_to_text(attr.u.num);
- emit statusChanged();
+ if(navigation_get_attr(nav, attr_nav_status, &attr,nullptr)){
+
+ int status = (attr.u.num == status_recalculating) ? status_routing : attr.u.num;
+ if(m_status != status){
+ m_status = static_cast<Status>(status);
+ qDebug() << "status : " << nav_status_to_text(status);
+ emit statusChanged();
+ }
}
}
void NavitRoute::routeCallbackHandler(NavitRoute * navitRoute){
@@ -200,7 +303,7 @@ void NavitRoute::destinationCallbackHandler(NavitRoute * navitRoute){
navitRoute->destinationUpdate();
}
-void NavitRoute::statusCallbackHandler(NavitRoute * navitRoute){
+void NavitRoute::statusCallbackHandler(NavitRoute * navitRoute, int status){
navitRoute->statusUpdate();
}
void NavitRoute::cancelNavigation(){
diff --git a/navit/gui/qt5_qml/navitroute.h b/navit/gui/qt5_qml/navitroute.h
index 28810c46c..890edc478 100644
--- a/navit/gui/qt5_qml/navitroute.h
+++ b/navit/gui/qt5_qml/navitroute.h
@@ -4,6 +4,7 @@
#include <QObject>
#include <QDebug>
#include <QTime>
+#include <QUrl>
#include "navitinstance.h"
#include <glib.h>
@@ -27,6 +28,11 @@ extern "C" {
#include "route.h"
#include "navigation.h"
#include "layout.h"
+#include "graphics.h"
+#include "vehicle.h"
+#include "vehicleprofile.h"
+#include "roadprofile.h"
+#include "track.h"
#include "proxy.h"
}
@@ -36,18 +42,24 @@ extern "C" {
class NavitRoute : public QObject
{
Q_OBJECT
- Q_PROPERTY(NavitInstance * navit MEMBER m_navitInstance WRITE setNavit)
- Q_PROPERTY(QStringList directions READ getDirections NOTIFY propertiesChanged)
- Q_PROPERTY(QString distance READ getDistance NOTIFY propertiesChanged)
- Q_PROPERTY(QString timeLeft READ getTimeLeft NOTIFY propertiesChanged)
- Q_PROPERTY(QString arrivalTime READ getArrivalTime NOTIFY propertiesChanged)
- Q_PROPERTY(Status status READ getStatus NOTIFY statusChanged)
+ Q_PROPERTY(NavitInstance * navit MEMBER m_navitInstance WRITE setNavit)
+ Q_PROPERTY(QStringList directions READ getDirections NOTIFY propertiesChanged)
+ Q_PROPERTY(QString distance READ getDistance NOTIFY propertiesChanged)
+ Q_PROPERTY(QString timeLeft READ getTimeLeft NOTIFY propertiesChanged)
+ Q_PROPERTY(QString arrivalTime READ getArrivalTime NOTIFY propertiesChanged)
+ Q_PROPERTY(QString currentStreet READ getCurrentStreet NOTIFY propertiesChanged)
+ Q_PROPERTY(int speed READ getSpeed NOTIFY propertiesChanged)
+ Q_PROPERTY(int speedLimit READ getSpeedLimit NOTIFY propertiesChanged)
+ Q_PROPERTY(Status status READ getStatus NOTIFY statusChanged)
+ Q_PROPERTY(QUrl nextTurnIcon READ getNextTurnIcon NOTIFY nextTurnChanged)
+ Q_PROPERTY(QString nextTurn READ getNextTurn NOTIFY nextTurnChanged)
+ Q_PROPERTY(QString nextTurnDistance READ getNextTurnDistance NOTIFY nextTurnChanged)
public:
NavitRoute();
void setNavit(NavitInstance * navit);
static void routeCallbackHandler(NavitRoute * navitRoute);
static void destinationCallbackHandler(NavitRoute * navitRoute);
- static void statusCallbackHandler(NavitRoute * navitRoute);
+ static void statusCallbackHandler(NavitRoute * navitRoute, int status);
void routeUpdate();
void destinationUpdate();
void statusUpdate();
@@ -68,6 +80,7 @@ signals:
void destinationRemoved();
void navigationFinished();
void statusChanged();
+ void nextTurnChanged();
public slots:
void setDestination(QString label, int x, int y);
void setPosition(int x, int y);
@@ -80,6 +93,12 @@ private:
QString m_distance;
QString m_timeLeft;
QString m_arrivalTime;
+ QString m_currentStreet;
+ QString m_nextTurn;
+ QString m_nextTurnDistance;
+ int m_speed;
+ int m_speedLimit;
+ QUrl m_nextTurnIcon;
Status m_status;
QString m_lastDestination;
@@ -87,6 +106,7 @@ private:
int m_destCount;
QString getLastDestination(pcoord *pc);
+ void updateNextTurn(struct map * map);
QStringList getDirections() {
return m_directions;
}
@@ -99,9 +119,27 @@ private:
QString getArrivalTime() {
return m_arrivalTime;
}
+ QString getCurrentStreet() {
+ return m_currentStreet;
+ }
+ QString getNextTurn() {
+ return m_nextTurn;
+ }
+ QString getNextTurnDistance() {
+ return m_nextTurnDistance;
+ }
+ int getSpeed() {
+ return m_speed;
+ }
+ int getSpeedLimit() {
+ return m_speedLimit;
+ }
Status getStatus(){
return m_status;
}
+ QUrl getNextTurnIcon(){
+ return m_nextTurnIcon;
+ }
};
#endif // NAVITROUTE_H
diff --git a/navit/gui/qt5_qml/themes/Levy/DestinationDetailsBar.qml b/navit/gui/qt5_qml/themes/Levy/DestinationDetailsBar.qml
index 9f123446c..dccb5d7be 100644
--- a/navit/gui/qt5_qml/themes/Levy/DestinationDetailsBar.qml
+++ b/navit/gui/qt5_qml/themes/Levy/DestinationDetailsBar.qml
@@ -10,7 +10,7 @@ Item {
signal addBookmarkClicked()
Rectangle{
id: buttonsBackground
- height: parent.height * 0.45
+ height: parent.height * 0.65
anchors.right: parent.right
anchors.left: parent.left
border.width: 1
@@ -30,80 +30,73 @@ Item {
}
}
- ColumnLayout {
+
+ RowLayout {
id: rowLayout
- height: parent.height * 0.45
+ height: parent.height * 0.25
anchors.bottom: parent.bottom
- anchors.bottomMargin: 0
anchors.right: parent.right
anchors.left: parent.left
anchors.leftMargin: 0
spacing: 0
-
- RowLayout {
+ Rectangle {
+ color: "#ffffff"
+ radius: height/2
Layout.fillHeight: true
Layout.fillWidth: true
- Rectangle {
- height: parent.height*0.8
- color: "#ffffff"
- radius: height/2
- Layout.fillHeight: true
- Layout.fillWidth: true
- border.width: 1
-
- Text {
- text: qsTr("Route Overview")
- font.pointSize: 16
- fontSizeMode: Text.HorizontalFit
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: __root.routeOverviewClicked()
- }
+ border.width: 1
+
+ Text {
+ text: qsTr("Route Overview")
+ font.pointSize: 16
+ fontSizeMode: Text.HorizontalFit
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
}
+ MouseArea {
+ anchors.fill: parent
+ onClicked: __root.routeOverviewClicked()
+ }
+ }
- Rectangle {
- height: parent.height*0.8
- color: "#ffffff"
- radius: height/2
- Layout.fillHeight: true
- Layout.fillWidth: true
- border.width: 1
- Text {
- text: qsTr("POIs")
- anchors.verticalCenter: parent.verticalCenter
- font.pointSize: 16
- anchors.horizontalCenter: parent.horizontalCenter
- fontSizeMode: Text.HorizontalFit
- }
- MouseArea {
- anchors.fill: parent
- onClicked: __root.poisClicked()
- }
+ Rectangle {
+ id: rectangle1
+ color: "#ffffff"
+ radius: height/2
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ border.width: 1
+ Text {
+ text: qsTr("POIs")
+ anchors.verticalCenter: parent.verticalCenter
+ font.pointSize: 16
+ anchors.horizontalCenter: parent.horizontalCenter
+ fontSizeMode: Text.HorizontalFit
}
+ MouseArea {
+ anchors.fill: parent
+ onClicked: __root.poisClicked()
+ }
+ }
- Rectangle {
- id: rectangle
- height: parent.height*0.8
- color: "#ffffff"
- radius: height/2
- Layout.fillHeight: true
- Layout.fillWidth: true
- border.width: 1
-
- Text {
- text: qsTr("Add as Bookmark")
- fontSizeMode: Text.HorizontalFit
- anchors.horizontalCenter: parent.horizontalCenter
- font.pointSize: 16
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: __root.addBookmarkClicked()
- }
+ Rectangle {
+ id: rectangle
+ color: "#ffffff"
+ radius: height/2
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ border.width: 1
+
+ Text {
+ text: qsTr("Add as Bookmark")
+ fontSizeMode: Text.HorizontalFit
+ anchors.horizontalCenter: parent.horizontalCenter
+ font.pointSize: 16
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: __root.addBookmarkClicked()
}
}
}
@@ -118,6 +111,10 @@ Item {
+
+
+
+
/*##^## Designer {
D{i:0;autoSize:true;height:240;width:1200}D{i:1;anchors_height:240}
}
diff --git a/navit/gui/qt5_qml/themes/Levy/Instructions.qml b/navit/gui/qt5_qml/themes/Levy/Instructions.qml
new file mode 100644
index 000000000..b5cd83743
--- /dev/null
+++ b/navit/gui/qt5_qml/themes/Levy/Instructions.qml
@@ -0,0 +1,73 @@
+import QtQuick 2.9
+
+Item {
+ id: __root
+ property string distance : "125 Meters"
+ property string street: "High Street"
+ property url icon: ""
+ width:childrenRect.width
+ Rectangle {
+ id: rectangle
+ color: "#ffffff"
+ radius: parent.height/2
+ anchors.bottom: parent.bottom
+ anchors.top: parent.top
+ border.color: "#000000"
+ border.width: 1
+ width:childrenRect.width + height
+
+ Image {
+ id: directionImage
+ x: height / 2
+ width: height
+ height: parent.height * 0.8
+ anchors.verticalCenter: parent.verticalCenter
+ source: icon
+ fillMode: Image.PreserveAspectFit
+ }
+ Item{
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.left: directionImage.right
+ width: childrenRect.width
+ anchors.leftMargin: height * 0.25
+
+ Text {
+ text: distance
+ font.pixelSize: parent.height * 0.3
+ anchors.verticalCenterOffset: -height/2
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Text {
+ text: street
+ font.pixelSize: parent.height * 0.2
+ anchors.verticalCenterOffset: height/2
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ }
+ }
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*##^## Designer {
+ D{i:0;height:150}
+}
+ ##^##*/
diff --git a/navit/gui/qt5_qml/themes/Levy/MainLayout.qml b/navit/gui/qt5_qml/themes/Levy/MainLayout.qml
index eccd0f65f..478b111ef 100644
--- a/navit/gui/qt5_qml/themes/Levy/MainLayout.qml
+++ b/navit/gui/qt5_qml/themes/Levy/MainLayout.qml
@@ -21,7 +21,7 @@ Item {
__root.state = "routeOverview"
navit1.pitch = 0;
navit1.followVehicle = 0;
-// navit1.zoomToRoute();
+ navit1.zoomToRoute();
navit1.zoomOut(2);
}
@@ -30,7 +30,7 @@ Item {
__root.prevState = ""
mapNavigationBar.setNavigationState()
- navit1.pitch = 45;
+// navit1.pitch = 45;
navit1.followVehicle = 1
navit1.autoZoom = true
navit1.centerOnPosition()
@@ -170,8 +170,8 @@ Item {
id: mapControls
x: -width
width: parent.width > parent.height ? parent.height * 0.1 : parent.width * 0.1
- spacing: height * 0.02
anchors.topMargin: parent.height * 0.05
+ spacing: height * 0.02
anchors.top: parent.top
anchors.bottom: mapNavigationBar.top
pitch: navit1.pitch
@@ -214,7 +214,6 @@ Item {
}
}
-
MapNavigationBar {
id: mapNavigationBar
width: parent.width * 0.95 //parent.width > parent.height ? parent.width * 0.9 : parent.width
@@ -236,7 +235,39 @@ Item {
}
}
+ Rectangle {
+ id: currentStreet
+ width: currenStreetText.width * 1.3
+ height: parent.height * 0.05
+ color: "#ffffff"
+ radius: height/2
+ anchors.verticalCenter: destinationBar.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ border.width: 1
+ Text {
+ id: currenStreetText
+ text: navitRoute.currentStreet
+ anchors.horizontalCenter: parent.horizontalCenter
+ horizontalAlignment: Text.AlignHCenter
+ anchors.verticalCenter: parent.verticalCenter
+ font.pixelSize: 24
+ }
+ }
+
+ Instructions {
+ id: instructions
+ height: parent.height * 0.15
+ visible: mapNavigationBar.state=="navigationState"
+ anchors.rightMargin: parent.width * 0.025
+ anchors.right: parent.right
+ transformOrigin: Item.Right
+ anchors.topMargin: parent.height * 0.025
+ anchors.top: parent.top
+ icon: navitRoute.nextTurnIcon
+ distance: navitRoute.nextTurnDistance
+ street: navitRoute.nextTurn
+ }
DestinationBar {
id: destinationBar
@@ -262,7 +293,7 @@ Item {
DestinationDetailsBar {
id: destinationDetailsBar
- height: parent.width > parent.height ? parent.height * 0.2 : parent.width * 0.3
+ height: parent.width > parent.height ? parent.height * 0.15 : parent.width * 0.25
anchors.topMargin: parent.height * 0.05
// visible: false
clip: true
@@ -276,14 +307,27 @@ Item {
}
}
- RouteCalculating {
+ Rectangle {
id: routeCalculating
- width: parent.width * 0.4
+ width: calculatingText.width + height
height: parent.height * 0.05
anchors.topMargin: parent.height * 0.05
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
visible: (navitRoute.status === NavitRoute.Calculating || navitRoute.status === NavitRoute.Recalculating )
+
+ color: "#ffffff"
+ radius: height/2
+ border.width: 1
+
+ Text {
+ id: calculatingText
+ text: qsTr("Calculating Route...")
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 24
+ }
}
Item {
@@ -325,10 +369,19 @@ Item {
navit1.centerOnPosition()
}
}
-
}
-
+ SpeedGauge {
+ id: speedGauge
+ x: parent.width - ((parent.width * 0.025) + (mapNavigationBar.height / 2)) - (width / 2)
+ width: parent.width > parent.height ? parent.height * 0.1 : parent.width * 0.1
+ height: parent.width > parent.height ? parent.height * 0.15 : parent.width * 0.2
+ anchors.verticalCenterOffset: parent.height/4 - height/2
+ anchors.verticalCenter: parent.verticalCenter
+ speed: navitRoute.speed
+ speedLimit: navitRoute.speedLimit
+ speedUnit: "km/h"
+ }
Rectangle {
id: overlay
@@ -433,11 +486,6 @@ Item {
}
}
-
-
-
-
-
states: [
State {
name: "mapControlsVisible"
@@ -715,17 +763,17 @@ Item {
]
}
-
-
-
-
/*##^## Designer {
- D{i:0;height:720;width:1280}D{i:24;anchors_height:200;anchors_width:200}D{i:25;anchors_height:200;anchors_width:200}
-D{i:26;anchors_height:200;anchors_width:200}D{i:27;anchors_height:200;anchors_width:200}
-D{i:23;anchors_height:200;anchors_width:200}D{i:29;anchors_height:200;anchors_width:200}
-D{i:28;anchors_height:200;anchors_width:200}D{i:4;anchors_x:196}D{i:5;anchors_width:200;anchors_x:196}
-D{i:6;anchors_height:100;anchors_width:100}D{i:7;anchors_height:100;anchors_width:100}
-D{i:8;anchors_y:109}D{i:9;anchors_y:109}D{i:13;anchors_height:100;anchors_width:100}
-D{i:14;anchors_height:100;anchors_width:100;anchors_y:109}D{i:15;anchors_y:109}D{i:12;anchors_height:200;anchors_width:200}
+ D{i:0;height:720;width:1280}D{i:27;anchors_height:200;anchors_width:200}D{i:26;anchors_height:200;anchors_width:200}
+D{i:29;anchors_height:200;anchors_width:200}D{i:30;anchors_height:200;anchors_width:200}
+D{i:31;anchors_height:200;anchors_width:200}D{i:32;anchors_height:200;anchors_width:200}
+D{i:28;anchors_height:200;anchors_width:200}D{i:34;anchors_height:200;anchors_width:200}
+D{i:35;anchors_height:200;anchors_width:200}D{i:33;anchors_height:200;anchors_width:200}
+D{i:4;anchors_x:196}D{i:5;anchors_width:200;anchors_x:196}D{i:6;anchors_height:100;anchors_width:100}
+D{i:7;anchors_height:100;anchors_width:100}D{i:8;anchors_y:109}D{i:10;anchors_height:100;anchors_width:100;anchors_y:109}
+D{i:9;anchors_height:100;anchors_width:100;anchors_y:109}D{i:11;anchors_height:100;anchors_width:100;anchors_y:109}
+D{i:12;anchors_y:109}D{i:15;anchors_height:100;anchors_width:100}D{i:14;anchors_height:200;anchors_width:200}
+D{i:17;anchors_y:109}D{i:18;anchors_y:10}D{i:19;anchors_y:10}D{i:16;anchors_height:100;anchors_width:100;anchors_y:109}
+D{i:25;anchors_height:200;anchors_width:200}
}
##^##*/
diff --git a/navit/gui/qt5_qml/themes/Levy/RouteCalculating.qml b/navit/gui/qt5_qml/themes/Levy/RouteCalculating.qml
deleted file mode 100644
index 9b26ffc61..000000000
--- a/navit/gui/qt5_qml/themes/Levy/RouteCalculating.qml
+++ /dev/null
@@ -1,26 +0,0 @@
-import QtQuick 2.9
-
-Item {
- Rectangle {
- id: rectangle
- color: "#ffffff"
- radius: parent.height/2
- border.width: 1
- anchors.fill: parent
-
- Text {
- id: calculatingText
- text: qsTr("Calculating Route...")
- anchors.horizontalCenter: parent.horizontalCenter
- horizontalAlignment: Text.AlignHCenter
- anchors.verticalCenter: parent.verticalCenter
- font.pixelSize: 24
- }
- }
-
-}
-
-/*##^## Designer {
- D{i:0;autoSize:true;height:50;width:600}D{i:1;anchors_height:200;anchors_width:200}
-}
- ##^##*/
diff --git a/navit/gui/qt5_qml/themes/Levy/SpeedGauge.qml b/navit/gui/qt5_qml/themes/Levy/SpeedGauge.qml
new file mode 100644
index 000000000..662550fa7
--- /dev/null
+++ b/navit/gui/qt5_qml/themes/Levy/SpeedGauge.qml
@@ -0,0 +1,111 @@
+import QtQuick 2.9
+import QtGraphicalEffects 1.0
+
+Item {
+ id: __root
+
+ property int speed: 0
+ property string speedUnit: "km/h"
+ property int speedLimit: 0
+
+ onSpeedChanged: {
+ if(speed > speedLimit && speedLimit > 0){
+ __root.state = "over_limit"
+ } else {
+ __root.state = ""
+ }
+ }
+ onSpeedLimitChanged: {
+ if(speed > speedLimit && speedLimit > 0){
+ __root.state = "over_limit"
+ } else {
+ __root.state = ""
+ }
+ }
+
+ Rectangle {
+ id: rectangle
+ width: height
+ color: "#ffffff"
+ radius: height
+ border.width: 1
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Item {
+ id: element2
+ anchors.fill: parent
+
+ Text {
+ id: speedText
+ text: speed
+ anchors.verticalCenterOffset: -height * 0.1
+ font.pixelSize: parent.height * 0.4
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Text {
+ id: speedUnitText
+ text: speedUnit
+ font.pixelSize: parent.height * 0.1
+ anchors.verticalCenterOffset: height*2
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ Rectangle {
+ id: rectangle1
+ width: height
+ height: parent.height /2
+ color: "#ffffff"
+ radius: height/2
+ visible: speedLimit > 0
+ border.width: height * 0.1
+ border.color: "#000000"
+ anchors.topMargin: -height/2
+ anchors.rightMargin: -width/2
+ anchors.right: parent.right
+ anchors.top: parent.top
+
+ Text {
+ id: speedLimitText
+ text: speedLimit
+ font.pixelSize: parent.height * 0.4
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+ }
+ states: [
+ State {
+ name: "over_limit"
+
+ PropertyChanges {
+ target: speedText
+ color: "#ee0808"
+ }
+
+ PropertyChanges {
+ target: rectangle1
+ anchors.rightMargin: -width * 0.4
+ anchors.topMargin: -height * 0.4
+ visible: true
+ border.color: "#ee0808"
+ }
+ }
+ ]
+
+}
+
+
+
+
+
+/*##^## Designer {
+ D{i:0;autoSize:true;height:480;width:640}D{i:2;anchors_height:200;anchors_width:200}
+D{i:1;anchors_height:200;anchors_y:267}
+}
+ ##^##*/