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 {
id: zoomToPositionButton
anchors {
right: parent.right
rightMargin: 0.005 * root.width
rightMargin: Screen.pixelDensity * 1
bottom: routeEditorButton.top
bottomMargin: 10
}
......@@ -286,8 +286,7 @@ ApplicationWindow {
bottom: dialogContainer.height > 0 ? undefined : parent.bottom
verticalCenter: dialogContainer.height > 0 ? dialogContainer.top : undefined
horizontalCenter: zoomToPositionButton.horizontalCenter
margins: 0.01 * root.width
bottomMargin: 25
bottomMargin: Screen.pixelDensity * 4
}
onClicked: {
......@@ -355,8 +354,6 @@ ApplicationWindow {
PropertyChanges { target: placemarkDialog; visible: false }
PropertyChanges { target: routeEditor; visible: false }
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); }
},
State {
......
......@@ -17,58 +17,74 @@ Item {
id: root
property real distance: 0
property alias instructionIcon: image.source
property real destinationDistance: 0
property alias instructionIcon: instructionImage.source
width: parent.width
height: iconBackground.height
function formatDistance(distance)
{
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
colorGroup: SystemPalette.Active
}
Rectangle {
id: textBackground
color: palette.window
anchors{
left: iconBackground.right
right: parent.right
anchors.fill: parent
color: palette.base
}
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 {
id: distanceUntilInstruction
anchors.left: instructionImage.right
anchors.verticalCenter: parent.verticalCenter
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)
anchors.centerIn: parent
text: root.formatDistance(root.distance)
}
}
Rectangle {
anchors{
left: parent.left
right: textBackground.left
top: textBackground.top
bottom: textBackground.bottom
}
Item {
id: targetItem
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
color: palette.window
Text {
id: targetText
anchors.right: targetImage.left
anchors.verticalCenter: parent.verticalCenter
font.pointSize: 16
text: root.formatDistance(root.destinationDistance)
}
Rectangle {
id: iconBackground
color: palette.window
width: Screen.pixelDensity * 12.5
height: width
radius: 0.1 * width
Image {
id: image
anchors.centerIn: parent
width: parent.width * 0.8
id: targetImage
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
width: Screen.pixelDensity * 10
height: width
sourceSize.height: height
sourceSize.width: width
source: "qrc:///ic_place_arrival.png"
}
}
}
......@@ -23,7 +23,6 @@ Item {
property bool guidanceMode: false
property alias screenAccuracy: navigation.screenAccuracy
property alias deviated: navigation.deviated
property alias speedDistancePanelheight: speedDistancePanel.height
onGuidanceModeChanged: {
if (guidanceMode) {
......@@ -34,6 +33,13 @@ Item {
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 {
id: infoBar
anchors {
......@@ -43,6 +49,7 @@ Item {
}
instructionIcon: navigation.nextInstructionImage.replace("qrc:/", "qrc:///");
distance: navigation.nextInstructionDistance;
destinationDistance: navigation.destinationDistance
}
CircularButton {
......@@ -53,48 +60,11 @@ Item {
anchors.right: infoBar.right
anchors.rightMargin: Screen.pixelDensity * 3
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"
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 {
id: navigation
marbleQuickItem: marbleItem
......
......@@ -32,9 +32,7 @@ Item {
}
onPlacemarkChanged: {
if (placemark) {
itemStack.state = "place"
}
itemStack.state = placemark ? "place" : ""
}
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