Commit 07a185c1 authored by Dennis Nienhüser's avatar Dennis Nienhüser

Merge bottom navigation panel into top. Border icon, margin tweaks.

parent f7ad3bf4
...@@ -260,7 +260,7 @@ ApplicationWindow { ...@@ -260,7 +260,7 @@ ApplicationWindow {
id: zoomToPositionButton id: zoomToPositionButton
anchors { anchors {
right: parent.right right: parent.right
rightMargin: 0.005 * root.width rightMargin: Screen.pixelDensity * 1
bottom: routeEditorButton.top bottom: routeEditorButton.top
bottomMargin: 10 bottomMargin: 10
} }
...@@ -286,8 +286,7 @@ ApplicationWindow { ...@@ -286,8 +286,7 @@ ApplicationWindow {
bottom: dialogContainer.height > 0 ? undefined : parent.bottom bottom: dialogContainer.height > 0 ? undefined : parent.bottom
verticalCenter: dialogContainer.height > 0 ? dialogContainer.top : undefined verticalCenter: dialogContainer.height > 0 ? dialogContainer.top : undefined
horizontalCenter: zoomToPositionButton.horizontalCenter horizontalCenter: zoomToPositionButton.horizontalCenter
margins: 0.01 * root.width bottomMargin: Screen.pixelDensity * 4
bottomMargin: 25
} }
onClicked: { onClicked: {
...@@ -355,8 +354,6 @@ ApplicationWindow { ...@@ -355,8 +354,6 @@ ApplicationWindow {
PropertyChanges { target: placemarkDialog; visible: false } PropertyChanges { target: placemarkDialog; visible: false }
PropertyChanges { target: routeEditor; visible: false } PropertyChanges { target: routeEditor; visible: false }
PropertyChanges { target: navigationManager; guidanceMode: true } PropertyChanges { target: navigationManager; guidanceMode: true }
PropertyChanges { target: marbleMaps; anchors.bottomMargin: navigationManager.speedDistancePanelheight }
PropertyChanges { target: routeEditorButton; anchors.bottomMargin: navigationManager.speedDistancePanelheight + Screen.pixelDensity*4 }
StateChangeScript { script: itemStack.push(navigationManager); } StateChangeScript { script: itemStack.push(navigationManager); }
}, },
State { State {
......
...@@ -17,58 +17,74 @@ Item { ...@@ -17,58 +17,74 @@ Item {
id: root id: root
property real distance: 0 property real distance: 0
property alias instructionIcon: image.source property real destinationDistance: 0
property alias instructionIcon: instructionImage.source
width: parent.width function formatDistance(distance)
height: iconBackground.height {
if (distance > 1000) {
return "%1 km".arg((0.001 * distance).toFixed(1))
} else if (distance > 100) {
return "%1 m".arg((distance*0.01).toFixed(0)*100)
} else {
return "%1 m".arg((distance*0.1).toFixed(0)*10)
}
}
height: instructionImage.height
SystemPalette{ SystemPalette {
id: palette id: palette
colorGroup: SystemPalette.Active colorGroup: SystemPalette.Active
} }
Rectangle { Rectangle {
id: textBackground anchors.fill: parent
color: palette.window color: palette.base
anchors{ }
left: iconBackground.right
right: parent.right Item {
id: nextInstructionItem
anchors.verticalCenter: parent.verticalCenter
Image {
id: instructionImage
anchors.verticalCenter: parent.verticalCenter
width: Screen.pixelDensity * 15
height: width
sourceSize.height: height
sourceSize.width: width
} }
height: iconBackground.height
Text { Text {
id: distanceUntilInstruction id: distanceUntilInstruction
anchors.left: instructionImage.right
anchors.verticalCenter: parent.verticalCenter
font.pointSize: 24 font.pointSize: 24
text: root.distance > 1000 ? "%1 km".arg((0.001 * root.distance).toFixed(1)) : "%1 m".arg(distance > 100 ? (root.distance*0.01).toFixed(0)*100 : (root.distance*0.1).toFixed(0)*10) text: root.formatDistance(root.distance)
anchors.centerIn: parent
} }
} }
Rectangle { Item {
anchors{ id: targetItem
left: parent.left anchors.right: parent.right
right: textBackground.left anchors.verticalCenter: parent.verticalCenter
top: textBackground.top
bottom: textBackground.bottom
}
color: palette.window Text {
} id: targetText
anchors.right: targetImage.left
Rectangle { anchors.verticalCenter: parent.verticalCenter
id: iconBackground font.pointSize: 16
color: palette.window text: root.formatDistance(root.destinationDistance)
width: Screen.pixelDensity * 12.5 }
height: width
radius: 0.1 * width
Image { Image {
id: image id: targetImage
anchors.centerIn: parent anchors.right: parent.right
width: parent.width * 0.8 anchors.verticalCenter: parent.verticalCenter
width: Screen.pixelDensity * 10
height: width height: width
sourceSize.height: height source: "qrc:///ic_place_arrival.png"
sourceSize.width: width
} }
} }
} }
...@@ -23,7 +23,6 @@ Item { ...@@ -23,7 +23,6 @@ Item {
property bool guidanceMode: false property bool guidanceMode: false
property alias screenAccuracy: navigation.screenAccuracy property alias screenAccuracy: navigation.screenAccuracy
property alias deviated: navigation.deviated property alias deviated: navigation.deviated
property alias speedDistancePanelheight: speedDistancePanel.height
onGuidanceModeChanged: { onGuidanceModeChanged: {
if (guidanceMode) { if (guidanceMode) {
...@@ -34,6 +33,13 @@ Item { ...@@ -34,6 +33,13 @@ Item {
navigation.guidanceModeEnabled = guidanceMode; navigation.guidanceModeEnabled = guidanceMode;
} }
BorderImage {
anchors.fill: infoBar
anchors.margins: -14
border { top: 14; left: 14; right: 14; bottom: 14 }
source: "qrc:///border_shadow.png"
}
NavigationInfoBar { NavigationInfoBar {
id: infoBar id: infoBar
anchors { anchors {
...@@ -43,6 +49,7 @@ Item { ...@@ -43,6 +49,7 @@ Item {
} }
instructionIcon: navigation.nextInstructionImage.replace("qrc:/", "qrc:///"); instructionIcon: navigation.nextInstructionImage.replace("qrc:/", "qrc:///");
distance: navigation.nextInstructionDistance; distance: navigation.nextInstructionDistance;
destinationDistance: navigation.destinationDistance
} }
CircularButton { CircularButton {
...@@ -53,48 +60,11 @@ Item { ...@@ -53,48 +60,11 @@ Item {
anchors.right: infoBar.right anchors.right: infoBar.right
anchors.rightMargin: Screen.pixelDensity * 3 anchors.rightMargin: Screen.pixelDensity * 3
anchors.top: infoBar.bottom anchors.top: infoBar.bottom
anchors.topMargin: Screen.pixelDensity * 3 anchors.topMargin: Screen.pixelDensity * 5
iconSource: muted ? "qrc:///material/volume-off.svg" : "qrc:///material/volume-on.svg" iconSource: muted ? "qrc:///material/volume-off.svg" : "qrc:///material/volume-on.svg"
onClicked: muted = !muted onClicked: muted = !muted
} }
Rectangle{
id: speedDistancePanel
color: palette.window
height: totalDistance.height * 2
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
}
BoxedText {
id: totalDistance
color: palette.window
textColor: palette.text
text: "%1 km".arg((0.001 * navigation.destinationDistance).toFixed(1))
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: 10
}
}
BoxedText {
id: speed
color: palette.window
textColor: palette.text
text: qsTr("%1 km/h".arg((navigation.marbleQuickItem.speed * 3.6).toFixed(0)))
anchors {
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: 10
}
}
}
Navigation { Navigation {
id: navigation id: navigation
marbleQuickItem: marbleItem marbleQuickItem: marbleItem
......
...@@ -32,9 +32,7 @@ Item { ...@@ -32,9 +32,7 @@ Item {
} }
onPlacemarkChanged: { onPlacemarkChanged: {
if (placemark) { itemStack.state = placemark ? "place" : ""
itemStack.state = "place"
}
} }
SystemPalette { SystemPalette {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment