2015-07-10 08:40:30 +00:00
|
|
|
import QtQuick 2.3
|
|
|
|
import QtQuick.Controls 1.2
|
|
|
|
import QtQuick.Window 2.2
|
|
|
|
import QtQuick.Dialogs 1.2
|
|
|
|
import org.subsurfacedivelog.mobile 1.0
|
2015-07-10 08:45:20 +00:00
|
|
|
import QtQuick.Layouts 1.0
|
2015-07-10 08:40:30 +00:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: page
|
2015-08-20 08:44:01 +00:00
|
|
|
objectName: "DiveList"
|
2015-07-10 08:40:30 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: diveDelegate
|
|
|
|
Item {
|
|
|
|
id: dive
|
|
|
|
|
|
|
|
property real detailsOpacity : 0
|
|
|
|
|
2015-10-09 01:56:36 +00:00
|
|
|
width: diveListView.width - units.spacing
|
2015-07-12 17:52:44 +00:00
|
|
|
height: childrenRect.height
|
2015-07-10 08:40:30 +00:00
|
|
|
|
|
|
|
//Mouse region: When clicked, the mode changes to details view
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
2015-07-21 12:00:29 +00:00
|
|
|
onClicked: {
|
|
|
|
detailsWindow.width = parent.width
|
|
|
|
detailsWindow.location = location
|
|
|
|
detailsWindow.dive_id = id
|
|
|
|
detailsWindow.buddy = buddy
|
|
|
|
detailsWindow.suit = suit
|
|
|
|
detailsWindow.airtemp = airtemp
|
|
|
|
detailsWindow.watertemp = watertemp
|
|
|
|
detailsWindow.divemaster = divemaster
|
|
|
|
detailsWindow.notes = notes
|
2015-07-27 19:26:51 +00:00
|
|
|
detailsWindow.number = diveNumber
|
|
|
|
detailsWindow.date = date
|
2015-07-21 12:00:29 +00:00
|
|
|
stackView.push(detailsWindow)
|
|
|
|
}
|
2015-07-10 08:40:30 +00:00
|
|
|
}
|
|
|
|
|
2015-07-27 06:51:53 +00:00
|
|
|
//Layout of the page: (mini profile, dive no, date at the top
|
2015-07-10 08:40:30 +00:00
|
|
|
//And other details at the bottom.
|
2015-10-09 01:56:36 +00:00
|
|
|
Column {
|
|
|
|
x: units.spacing
|
|
|
|
width: parent.width - units.spacing * 2
|
|
|
|
height: childrenRect.height + units.spacing * 2
|
|
|
|
spacing: units.spacing / 2
|
|
|
|
anchors.margins: units.spacing
|
2015-07-10 08:40:30 +00:00
|
|
|
|
2015-10-09 01:56:36 +00:00
|
|
|
Text {
|
|
|
|
text: diveNumber + ' (' + date + ')'
|
|
|
|
}
|
|
|
|
Text { text: location; width: parent.width }
|
|
|
|
Text { text: '<b>Depth:</b> ' + depth + ' <b>Duration:</b> ' + duration; width: parent.width }
|
|
|
|
Rectangle {
|
|
|
|
color: theme.textColor
|
|
|
|
opacity: .2
|
|
|
|
width: parent.width
|
|
|
|
height: Math.max(1, units.gridUnit / 24) // we really want a thin line
|
2015-07-10 08:40:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: tripHeading
|
2015-10-09 01:56:36 +00:00
|
|
|
Item {
|
|
|
|
width: page.width - units.spacing * 2
|
|
|
|
height: childrenRect.height + units.spacing * 2
|
2015-07-10 08:40:30 +00:00
|
|
|
|
|
|
|
Text {
|
2015-10-09 01:56:36 +00:00
|
|
|
id: sectionText
|
2015-07-10 08:40:30 +00:00
|
|
|
text: section
|
2015-10-09 01:56:36 +00:00
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: units.spacing
|
|
|
|
right: parent.right
|
|
|
|
}
|
|
|
|
color: theme.textColor
|
2015-07-10 08:40:30 +00:00
|
|
|
font.pointSize: 16
|
|
|
|
}
|
2015-10-09 01:56:36 +00:00
|
|
|
Rectangle {
|
|
|
|
height: Math.max(2, units.gridUnit / 12) // we want a thicker line
|
|
|
|
anchors {
|
|
|
|
top: sectionText.bottom
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: units.spacing
|
|
|
|
right: parent.right
|
|
|
|
}
|
|
|
|
color: theme.accentColor
|
|
|
|
}
|
2015-07-10 08:40:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: diveListView
|
|
|
|
anchors.fill: parent
|
|
|
|
model: diveModel
|
|
|
|
delegate: diveDelegate
|
2015-10-09 01:56:36 +00:00
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
//highlight: Rectangle { color: theme.highlightColor; width: units.spacing }
|
2015-07-10 08:40:30 +00:00
|
|
|
focus: true
|
2015-10-09 01:56:36 +00:00
|
|
|
clip: true
|
2015-07-10 08:40:30 +00:00
|
|
|
section.property: "trip"
|
|
|
|
section.criteria: ViewSection.FullString
|
|
|
|
section.delegate: tripHeading
|
|
|
|
}
|
|
|
|
}
|