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>
This commit is contained in:
Dirk Hohndel 2017-06-20 12:52:55 -07:00
parent 7ccda01e7e
commit 20dae442ad

View file

@ -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