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
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: diveDelegate
|
|
|
|
Item {
|
|
|
|
id: dive
|
|
|
|
|
|
|
|
property real detailsOpacity : 0
|
|
|
|
|
|
|
|
width: diveListView.width
|
2015-07-12 17:52:44 +00:00
|
|
|
height: childrenRect.height
|
2015-07-10 08:40:30 +00:00
|
|
|
|
|
|
|
//Bounded rect for the background
|
|
|
|
Rectangle {
|
|
|
|
id: background
|
|
|
|
x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2;
|
|
|
|
color: "ivory"
|
2015-07-21 12:00:29 +00:00
|
|
|
border.color: "lightblue"
|
2015-07-10 08:40:30 +00:00
|
|
|
radius: 5
|
|
|
|
}
|
|
|
|
|
|
|
|
//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.
|
|
|
|
Row {
|
|
|
|
id: topLayout
|
2015-07-12 17:52:44 +00:00
|
|
|
x: 10; y: 10; height: childrenRect.height; width: parent.width
|
2015-07-10 08:40:30 +00:00
|
|
|
|
|
|
|
Column {
|
2015-07-12 17:52:44 +00:00
|
|
|
width: background.width; height: childrenRect.height * 1.1
|
2015-07-10 08:40:30 +00:00
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: diveNumber + ' (' + date + ')'
|
|
|
|
}
|
2015-07-21 12:00:29 +00:00
|
|
|
Text { text: location; width: parent.width }
|
2015-07-27 06:51:53 +00:00
|
|
|
Text { text: '<b>Depth:</b> ' + depth + ' <b>Duration:</b> ' + duration; width: parent.width }
|
2015-07-10 08:40:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: tripHeading
|
|
|
|
Rectangle {
|
|
|
|
width: page.width
|
|
|
|
height: childrenRect.height
|
|
|
|
color: "lightsteelblue"
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: section
|
|
|
|
font.bold: true
|
|
|
|
font.pointSize: 16
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: diveListView
|
|
|
|
anchors.fill: parent
|
|
|
|
model: diveModel
|
|
|
|
delegate: diveDelegate
|
|
|
|
focus: true
|
|
|
|
|
|
|
|
section.property: "trip"
|
|
|
|
section.criteria: ViewSection.FullString
|
|
|
|
section.delegate: tripHeading
|
|
|
|
}
|
|
|
|
}
|