summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/main.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-07 22:33:44 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-13 11:32:27 -0700
commit2f0689d3b82f4e3db4e456b26e3dba299cfa18e4 (patch)
treedba90a1b2739be9d6472a3f7d44fdd2bbae60f9c /mobile-widgets/qml/main.qml
parent2ef401ef5f995153e366daaacd770d73a92c4503 (diff)
downloadsubsurface-2f0689d3b82f4e3db4e456b26e3dba299cfa18e4.tar.gz
Mobile: move pageIndex function to main.qml
This way it can be more easily called from other pages. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/main.qml')
-rw-r--r--mobile-widgets/qml/main.qml8
1 files changed, 8 insertions, 0 deletions
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index 94223c766..80dc329fe 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -90,6 +90,14 @@ Kirigami.ApplicationWindow {
pageStack.push(mapPage)
}
+ function pageIndex(pageToFind) {
+ for (var i = 0; i < pageStack.contentItem.contentChildren.length; i++) {
+ if (pageStack.contentItem.contentChildren[i] === pageToFind)
+ return i
+ }
+ return -1
+ }
+
function startAddDive() {
detailsWindow.state = "add"
detailsWindow.dive_id = manager.addDive();