Skip to content

Commit

Permalink
[silica] add cover actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rinigus committed Aug 3, 2019
1 parent e29a393 commit 98793e0
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions qml/platform.silica/Cover.qml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,29 @@ CoverBackground {
* Navigation narrative cover
*/

CoverActionList {
enabled: app.initialized && app.conf.showNarrative && map.hasRoute

CoverAction {
iconSource: app.mode === modes.navigate ? "image://theme/icon-cover-pause" :
"image://theme/icon-cover-play"
onTriggered: {
app.hideNavigationPages();
if (app.mode === modes.navigate) app.setModeExploreRoute();
else app.setModeNavigate();
}
}

CoverAction {
iconSource: "image://theme/icon-cover-cancel"
onTriggered: {
app.setModeExplore();
map.clearRoute();
app.showMap();
}
}
}

Image {
// Maneuver icon
anchors.bottom: parent.verticalCenter
Expand All @@ -83,7 +106,7 @@ CoverBackground {

Label {
// Distance remaining to destination
anchors.bottom: parent.bottom
anchors.bottom: parent.coverActionArea.top
anchors.bottomMargin: Theme.paddingLarge
anchors.left: parent.left
anchors.leftMargin: Theme.paddingLarge
Expand All @@ -95,7 +118,7 @@ CoverBackground {

Label {
// Time remaining to destination
anchors.bottom: parent.bottom
anchors.bottom: parent.coverActionArea.top
anchors.bottomMargin: Theme.paddingLarge
anchors.right: parent.right
anchors.rightMargin: Theme.paddingLarge
Expand All @@ -104,5 +127,4 @@ CoverBackground {
text: app.navigationStatus.destTime
visible: cover.showNarrative
}

}

0 comments on commit 98793e0

Please sign in to comment.