summaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-02 16:53:20 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-02 17:01:37 -0500
commitd95805e90be0a05f4c86f2173b8366470f60412b (patch)
treef5f920a669e488df9ad0d30d31327ab3d97d75a3 /qt-mobile
parent09856b4546de1fd2de563e51a4f26b42eedfeaef (diff)
downloadsubsurface-d95805e90be0a05f4c86f2173b8366470f60412b.tar.gz
QML UI: tap on the very top / title bar of dive list goes to top
This requires changes to Kirigami that aren't upstream, yet. So there's a chance that this commit will have to be changed or reverted / redone. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r--qt-mobile/qml/DiveList.qml14
1 files changed, 14 insertions, 0 deletions
diff --git a/qt-mobile/qml/DiveList.qml b/qt-mobile/qml/DiveList.qml
index de511f1d9..95af9a973 100644
--- a/qt-mobile/qml/DiveList.qml
+++ b/qt-mobile/qml/DiveList.qml
@@ -263,6 +263,20 @@ Kirigami.ScrollablePage {
}
}
}
+ Connections {
+ target: header
+ onTitleBarClicked: {
+ // if we can see the dive list and it's not at the top already, go to the top,
+ // otherwise have the title bar handle the click (for bread-crumb navigation)
+ if (stackView.currentItem.objectName === "DiveList" && diveListView.contentY > Kirigami.Units.gridUnit) {
+ diveListView.positionViewAtBeginning()
+ event.accepted = true
+ } else {
+ event.accepted = false
+ }
+ }
+ }
+
}
property QtObject addDiveAction: Action {