From 20dae442ad48108416a47d3ff45461d5474cd182 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 20 Jun 2017 12:52:55 -0700 Subject: [PATCH] QML UI: DiveDetailsView add button for map Implementing another suggestion from Davide. A button to get the map (as well as just tapping on the location name). Fixes #431 Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveDetailsView.qml | 32 +++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/mobile-widgets/qml/DiveDetailsView.qml b/mobile-widgets/qml/DiveDetailsView.qml index b2ad2d4cd..5053f866f 100644 --- a/mobile-widgets/qml/DiveDetailsView.qml +++ b/mobile-widgets/qml/DiveDetailsView.qml @@ -43,7 +43,7 @@ Item { anchors { left: parent.left top: parent.top - right: parent.right + right: gpsButton.left margins: Math.round(Kirigami.Units.gridUnit / 2) } MouseArea { @@ -55,6 +55,36 @@ Item { } } } + Rectangle { + id: gpsButton + height: Math.round(1.5 * Kirigami.Units.gridUnit) + width: dive.gps == "" ? 0 : buttonText.width + Kirigami.Units.gridUnit + color: subsurfaceTheme.accentColor + antialiasing: true + radius: Kirigami.Units.smallSpacing * 2 + anchors { + right: parent.right + top: parent.top + topMargin: Math.round(Kirigami.Units.gridUnit / 2) + } + Kirigami.Label { + id: buttonText + text: qsTr("Map it") + color: subsurfaceTheme.darkBackgroundColor + anchors { + horizontalCenter: parent.horizontalCenter + verticalCenter: parent.verticalCenter + } + } + MouseArea { + anchors.fill: parent + visible: dive.gps_decimal !== "" + onClicked: { + if (dive.gps_decimal !== "") + showMap(dive.gps_decimal) + } + } + } Row { anchors { left: locationText.left