diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-06-20 12:52:55 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-06-20 13:28:46 -0700 |
commit | 20dae442ad48108416a47d3ff45461d5474cd182 (patch) | |
tree | a9e8f141d97ce61eb9171b70906afc710107af7e /mobile-widgets | |
parent | 7ccda01e7e9a9be74c4a6461df4d002100e3ac5e (diff) | |
download | subsurface-20dae442ad48108416a47d3ff45461d5474cd182.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/DiveDetailsView.qml | 32 |
1 files changed, 31 insertions, 1 deletions
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 |