aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
Diffstat (limited to 'qt-mobile')
-rw-r--r--qt-mobile/qml/About.qml11
-rw-r--r--qt-mobile/qml/DiveDetails.qml32
-rw-r--r--qt-mobile/qml/DownloadFromDiveComputer.qml11
-rw-r--r--qt-mobile/qml/GpsList.qml10
-rw-r--r--qt-mobile/qml/Log.qml11
-rw-r--r--qt-mobile/qml/Preferences.qml12
6 files changed, 83 insertions, 4 deletions
diff --git a/qt-mobile/qml/About.qml b/qt-mobile/qml/About.qml
index fb389ca86..87d7a0a3e 100644
--- a/qt-mobile/qml/About.qml
+++ b/qt-mobile/qml/About.qml
@@ -8,6 +8,17 @@ MobileComponents.Page {
id: aboutPage
property int pageWidth: subsurfaceTheme.columnWidth - MobileComponents.Units.gridUnit
+ contextualActions: [
+ Action {
+ text: "Close About"
+ iconName: "dialog-cancel"
+ onTriggered: {
+ stackView.pop()
+ contextDrawer.close()
+ }
+ }
+ ]
+
ScrollView {
anchors.fill: parent
diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml
index 69c30e4ae..3f637784e 100644
--- a/qt-mobile/qml/DiveDetails.qml
+++ b/qt-mobile/qml/DiveDetails.qml
@@ -45,16 +45,40 @@ MobileComponents.Page {
}
]
+
+ function endAddMode() {
+ // edit was canceled - so remove the dive from the dive list
+ manager.addDiveAborted(dive_id)
+ state = "view"
+ Qt.inputMethod.hide()
+ }
+
+ contextualActions: [
+ Action {
+ text: state === "view" ? "Back to dive list" : "Cancel"
+ iconName: "dialog-cancel"
+ onTriggered: {
+ if (state === "view") {
+ stackView.pop()
+ contextDrawer.close()
+ } else if (state === "edit") {
+ endEditMode()
+ contextDrawer.close()
+ } else {
+ endAddMode()
+ contextDrawer.close()
+ }
+ }
+ }
+ ]
+
mainAction: Action {
iconName: state !== "view" ? "dialog-cancel" : "document-edit"
onTriggered: {
if (state === "edit") {
endEditMode()
} else if (state === "add") {
- // edit was canceled - so remove the dive from the dive list
- manager.addDiveAborted(dive_id)
- state = "view"
- Qt.inputMethod.hide()
+ endAddMode()
} else {
startEditMode()
}
diff --git a/qt-mobile/qml/DownloadFromDiveComputer.qml b/qt-mobile/qml/DownloadFromDiveComputer.qml
index 67f21345c..529af82eb 100644
--- a/qt-mobile/qml/DownloadFromDiveComputer.qml
+++ b/qt-mobile/qml/DownloadFromDiveComputer.qml
@@ -14,6 +14,17 @@ MobileComponents.Page {
height: parent.height
Layout.fillWidth: true;
+ contextualActions: [
+ Action {
+ text: "Close Preferences"
+ iconName: "dialog-cancel"
+ onTriggered: {
+ stackView.pop()
+ contextDrawer.close()
+ }
+ }
+ ]
+
ColumnLayout {
anchors.top: parent.top
height: parent.height
diff --git a/qt-mobile/qml/GpsList.qml b/qt-mobile/qml/GpsList.qml
index 2c30ae171..322b2b1a6 100644
--- a/qt-mobile/qml/GpsList.qml
+++ b/qt-mobile/qml/GpsList.qml
@@ -14,6 +14,16 @@ MobileComponents.Page {
anchors.margins: MobileComponents.Units.gridUnit / 2
objectName: "gpsList"
+ contextualActions: [
+ Action {
+ text: "Close GPS list"
+ iconName: "dialog-cancel"
+ onTriggered: {
+ stackView.pop()
+ contextDrawer.close()
+ }
+ }
+ ]
Component {
id: gpsDelegate
MobileComponents.ListItemWithActions {
diff --git a/qt-mobile/qml/Log.qml b/qt-mobile/qml/Log.qml
index 6e6ca0418..ac4750ac2 100644
--- a/qt-mobile/qml/Log.qml
+++ b/qt-mobile/qml/Log.qml
@@ -14,6 +14,17 @@ MobileComponents.Page {
anchors.margins: MobileComponents.Units.gridUnit / 2
objectName: "Log"
+ contextualActions: [
+ Action {
+ text: "Close Log"
+ iconName: "dialog-cancel"
+ onTriggered: {
+ stackView.pop()
+ contextDrawer.close()
+ }
+ }
+ ]
+
ScrollView {
anchors.fill: parent
Flickable {
diff --git a/qt-mobile/qml/Preferences.qml b/qt-mobile/qml/Preferences.qml
index ff1fbdf27..dbff31027 100644
--- a/qt-mobile/qml/Preferences.qml
+++ b/qt-mobile/qml/Preferences.qml
@@ -7,6 +7,18 @@ import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
import org.subsurfacedivelog.mobile 1.0
MobileComponents.Page {
+
+ contextualActions: [
+ Action {
+ text: "Close Preferences"
+ iconName: "dialog-cancel"
+ onTriggered: {
+ stackView.pop()
+ contextDrawer.close()
+ }
+ }
+ ]
+
GridLayout {
signal accept