diff options
author | Sebastian Kügler <sebas@kde.org> | 2016-01-12 01:15:02 +0100 |
---|---|---|
committer | Sebastian Kügler <sebas@kde.org> | 2016-01-12 03:06:09 +0100 |
commit | 6540e95425eb4c8aad56c5c5388c25b2180817cb (patch) | |
tree | 31ee60379f86868814b82e363719abc744d4a62c /qt-mobile/qml/DiveList.qml | |
parent | 9e85d767668faec8feec51ed00ed7c5b3db90cb3 (diff) | |
download | subsurface-6540e95425eb4c8aad56c5c5388c25b2180817cb.tar.gz |
dive details navigation
This patch reworks the navigation of the dive details.
- The detailsview is now a list view with page-sized delegates. This
allows horizontal swiping to the next and previous dive.
- The central button now allows to open the edit mode for the dive.
Original patch was done by Marco Martin, but needed to be reapplied by
hand.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Diffstat (limited to 'qt-mobile/qml/DiveList.qml')
-rw-r--r-- | qt-mobile/qml/DiveList.qml | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/qt-mobile/qml/DiveList.qml b/qt-mobile/qml/DiveList.qml index 06da8dee1..07b437c99 100644 --- a/qt-mobile/qml/DiveList.qml +++ b/qt-mobile/qml/DiveList.qml @@ -21,28 +21,11 @@ MobileComponents.Page { property real detailsOpacity : 0 property int horizontalPadding: MobileComponents.Units.gridUnit / 2 - MobileComponents.Units.smallSpacing + 1 - //When clicked, the mode changes to details view - + // When clicked, the mode changes to details view onClicked: { diveListView.currentIndex = model.index - detailsWindow.width = parent.width - detailsWindow.location = dive.location - detailsWindow.gps = dive.gps - detailsWindow.dive_id = dive.id - detailsWindow.diveNumber = dive.number - detailsWindow.duration = dive.duration - detailsWindow.depth = dive.depth - detailsWindow.rating = dive.rating - detailsWindow.buddy = dive.buddy - detailsWindow.suit = dive.suit - detailsWindow.airtemp = dive.airTemp - detailsWindow.watertemp = dive.waterTemp - detailsWindow.divemaster = dive.divemaster - detailsWindow.notes = dive.notes - detailsWindow.number = dive.number - detailsWindow.date = dive.date + " " + dive.time - // detailsWindow.weight = dive.weights - stackView.push(detailsWindow) + detailsWindow.showDiveIndex(index); + stackView.push(detailsWindow); } Item { @@ -154,6 +137,7 @@ MobileComponents.Page { } } } + ScrollView { anchors.fill: parent ListView { @@ -161,10 +145,14 @@ MobileComponents.Page { anchors.fill: parent model: diveModel currentIndex: -1 + Connections { + target: detailsWindow + onCurrentIndexChanged: diveListView.currentIndex = detailsWindow.currentIndex + } delegate: diveDelegate boundsBehavior: Flickable.StopAtBounds maximumFlickVelocity: parent.height * 5 - cacheBuffer: parent.height * 5 + cacheBuffer: Math.max(5000, parent.height * 5) //highlight: Rectangle { color: MobileComponents.Theme.highlightColor; width: MobileComponents.Units.smallSpacing } focus: true clip: true |