diff --git a/src/apps/marble-maps/MainScreen.qml b/src/apps/marble-maps/MainScreen.qml --- a/src/apps/marble-maps/MainScreen.qml +++ b/src/apps/marble-maps/MainScreen.qml @@ -138,14 +138,6 @@ visible: !navigationManager.visible } - NavigationManager { - id: navigationManager - width: parent.width - height: parent.height - visible: false - marbleItem: marbleMaps - } - BoxedText { id: quitHelper visible: false @@ -169,6 +161,14 @@ } } + NavigationManager { + id: navigationManager + width: parent.width + height: parent.height + visible: false + marbleItem: marbleMaps + } + BorderImage { anchors.fill: dialogContainer anchors.margins: -14 @@ -337,6 +337,8 @@ 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 { diff --git a/src/apps/marble-maps/NavigationManager.qml b/src/apps/marble-maps/NavigationManager.qml --- a/src/apps/marble-maps/NavigationManager.qml +++ b/src/apps/marble-maps/NavigationManager.qml @@ -24,6 +24,7 @@ property bool guidanceMode: false property alias screenAccuracy: navigation.screenAccuracy property alias deviated: navigation.deviated + property alias speedDistancePanelheight: speedDistancePanel.height onGuidanceModeChanged: { if (guidanceMode) { @@ -52,29 +53,40 @@ distance: navigation.nextInstructionDistance; } - BoxedText { - id: totalDistance + Rectangle{ + id: speedDistancePanel color: palette.window - textColor: palette.text - text: "%1 km".arg((0.001 * navigation.destinationDistance).toFixed(1)) - + height: totalDistance.height * 2 anchors { bottom: parent.bottom left: parent.left - margins: 20 + right: parent.right } - } - BoxedText { - id: speed - color: palette.window - textColor: palette.text - text: qsTr("%1 km/h".arg((navigation.marbleQuickItem.speed * 3.6).toFixed(0))) + BoxedText { + id: totalDistance + color: palette.window + textColor: palette.text + text: "%1 km".arg((0.001 * navigation.destinationDistance).toFixed(1)) - anchors { - bottom: totalDistance.top - left: parent.left - margins: 20 + 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 + } } }