diff --git a/src/apps/marble-maps/PlacemarkDialog.qml b/src/apps/marble-maps/PlacemarkDialog.qml --- a/src/apps/marble-maps/PlacemarkDialog.qml +++ b/src/apps/marble-maps/PlacemarkDialog.qml @@ -19,12 +19,15 @@ id: root property var placemark: null - property string actionIconSource: viaGroup.current === addDestinationButton ? routeEditor.currentProfileIcon : "qrc:///add.png" + property string actionIconSource: routeEditor.currentProfileIcon - height: placemark === null ? 0 : Screen.pixelDensity * 6 + Math.max(infoLayout.height, actionsLayout.height) + height: placemark === null ? 0 : Screen.pixelDensity * 6 + infoLayout.height function addToRoute() { - viaGroup.current.execute() + ensureRouteHasDeparture() + routing.addViaByPlacemarkAtIndex(routing.waypointCount(), placemark) + routing.clearSearchResultPlacemarks() + placemark = null itemStack.state = "routing" } @@ -49,7 +52,7 @@ anchors { bottom: parent.bottom left: parent.left - right: actionsLayout.left + right: parent.right margins: Screen.pixelDensity * 2 } @@ -96,68 +99,6 @@ } } - Column { - id: actionsLayout - width: rowLayout.width - spacing: Screen.pixelDensity * 2 - anchors { - right: parent.right - rightMargin: Screen.pixelDensity * 2 - } - - Item { - id: spacer - height: Screen.pixelDensity * 5 - width: 1 - } - - Row { - id: rowLayout - anchors.right: parent.right - spacing: 0 - - ExclusiveGroup { - id: viaGroup - } - - RouteProfileRadioButton { - anchors.margins: 0 - visible: routing.routeRequestModel.count === 0 - exclusiveGroup: viaGroup - imageSource: "qrc:///ic_place_departure.png" - function execute() { - routing.addViaByPlacemarkAtIndex(0, placemark); - routing.removeSearchResultPlacemark(placemark); - placemark = null; - } - } - RouteProfileRadioButton { - anchors.margins: 0 - exclusiveGroup: viaGroup - imageSource: "qrc:///ic_place_via.png" - function execute() { - ensureRouteHasDeparture() - routing.addViaByPlacemark(placemark) - routing.clearSearchResultPlacemarks(); - placemark = null; - } - } - RouteProfileRadioButton { - id: addDestinationButton - anchors.margins: 0 - checked: true - exclusiveGroup: viaGroup - imageSource: "qrc:///ic_place_arrival.png" - function execute() { - ensureRouteHasDeparture() - routing.addViaByPlacemarkAtIndex(routing.waypointCount(), placemark) - routing.clearSearchResultPlacemarks(); - placemark = null; - } - } - } - } - function ensureRouteHasDeparture() { if (routing.routeRequestModel.count === 0) { if (marbleMaps.positionAvailable) {