Skip to content

Commit

Permalink
add actions to poi info page
Browse files Browse the repository at this point in the history
  • Loading branch information
rinigus committed Sep 1, 2018
1 parent 5b09bd4 commit 9908c82
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 2 deletions.
65 changes: 65 additions & 0 deletions qml/PoiInfoPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,71 @@ Page {
wrapMode: Text.WordWrap
}

SectionHeader {
height: implicitHeight + Theme.paddingMedium
text: app.tr("Actions")
}

IconListItem {
enabled: poi.coordinate
icon: "image://theme/icon-m-share"
label: app.tr("Share location")
onClicked: {
app.pageStack.push("SharePage.qml", {
"coordinate": poi.coordinate,
"title": poi.title,
});
}
}

IconListItem {
enabled: poi.coordinate
icon: "image://theme/icon-m-dot"
label: app.tr("Center on location")
onClicked: {
map.setCenter(
poi.coordinate.longitude,
poi.coordinate.latitude);
app.clearMenu();
}
}

IconListItem {
enabled: poi.coordinate
icon: "image://theme/icon-m-car"
label: app.tr("Navigate To")
onClicked: {
app.pageStack.push("RoutePage.qml", {
"to": [poi.coordinate.longitude, poi.coordinate.latitude],
"toText": poi.title,
});
}
}

IconListItem {
enabled: poi.coordinate
icon: "image://theme/icon-m-car"
label: app.tr("Navigate From")
onClicked: {
app.pageStack.push("RoutePage.qml", {
"from": [poi.coordinate.longitude, poi.coordinate.latitude],
"fromText": poi.title,
});
}
}

IconListItem {
enabled: poi.coordinate
icon: "image://theme/icon-m-whereami"
label: app.tr("Nearby")
onClicked: {
app.pageStack.push("NearbyPage.qml", {
"near": [poi.coordinate.longitude, poi.coordinate.latitude],
"nearText": poi.title,
});
}
}

SectionHeader {
height: text ? implicitHeight + Theme.paddingMedium : 0
text: poi.phone || poi.link ? app.tr("Contact") : ""
Expand Down
6 changes: 4 additions & 2 deletions qml/RoutePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,10 @@ Page {
}

Component.onCompleted: {
page.from = map.getPosition();
page.fromText = app.tr("Current position");
if (!page.from) {
page.from = map.getPosition();
page.fromText = app.tr("Current position");
}
}

onStatusChanged: {
Expand Down

0 comments on commit 9908c82

Please sign in to comment.