| 
									
										
										
										
											2017-05-29 19:55:36 +02:00
										 |  |  | import QtQuick 2.6 | 
					
						
							| 
									
										
										
										
											2017-10-29 13:44:22 +01:00
										 |  |  | import QtQuick.Controls 2.2 as Controls | 
					
						
							| 
									
										
										
										
											2017-05-29 19:55:36 +02:00
										 |  |  | import QtQuick.Window 2.2 | 
					
						
							|  |  |  | import QtQuick.Dialogs 1.2 | 
					
						
							|  |  |  | import QtQuick.Layouts 1.3 | 
					
						
							|  |  |  | import org.subsurfacedivelog.mobile 1.0 | 
					
						
							| 
									
										
										
										
											2018-09-27 22:09:26 +02:00
										 |  |  | import org.kde.kirigami 2.4 as Kirigami | 
					
						
							| 
									
										
										
										
											2017-05-29 19:55:36 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | Kirigami.AbstractListItem { | 
					
						
							|  |  |  | 	id: innerListItem | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	property string depth | 
					
						
							|  |  |  | 	property string datetime | 
					
						
							|  |  |  | 	property string duration | 
					
						
							| 
									
										
										
										
											2017-06-04 14:40:25 +02:00
										 |  |  | 	property bool selected | 
					
						
							| 
									
										
										
										
											2017-05-29 19:55:36 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	enabled: true | 
					
						
							|  |  |  | 	supportsMouseEvents: true | 
					
						
							|  |  |  | 	width: parent.width | 
					
						
							| 
									
										
										
										
											2017-07-23 07:54:43 -07:00
										 |  |  | 	height: Math.round(Kirigami.Units.gridUnit * 1.8) | 
					
						
							|  |  |  | 	padding: 0 | 
					
						
							| 
									
										
										
										
											2017-05-29 19:55:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-04 13:05:50 +02:00
										 |  |  | 	activeBackgroundColor: subsurfaceTheme.primaryColor | 
					
						
							| 
									
										
										
										
											2017-07-23 07:54:43 -07:00
										 |  |  | 	property color textColor: subsurfaceTheme.secondaryTextColor | 
					
						
							| 
									
										
										
										
											2017-05-29 19:55:36 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	Row { | 
					
						
							| 
									
										
										
										
											2017-07-23 07:54:43 -07:00
										 |  |  | 		id: downloadedDive | 
					
						
							| 
									
										
										
										
											2017-05-29 19:55:36 +02:00
										 |  |  | 		width: parent.width | 
					
						
							| 
									
										
										
										
											2017-07-23 07:54:43 -07:00
										 |  |  | 		spacing: Kirigami.Units.largeSpacing | 
					
						
							|  |  |  | 		padding: 0 | 
					
						
							|  |  |  | 		anchors.leftMargin: Math.round (Kirigami.Units.largeSpacing / 2) | 
					
						
							|  |  |  | 		anchors.fill: parent | 
					
						
							| 
									
										
										
										
											2017-05-29 19:55:36 +02:00
										 |  |  | 		add: Transition { | 
					
						
							|  |  |  | 			NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 400 } | 
					
						
							|  |  |  | 			NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 } | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2017-07-24 20:29:32 +02:00
										 |  |  | 		SsrfCheckBox { | 
					
						
							| 
									
										
										
										
											2017-06-04 14:40:25 +02:00
										 |  |  | 			id: diveIsSelected | 
					
						
							|  |  |  | 			checked: innerListItem.selected; | 
					
						
							| 
									
										
										
										
											2018-09-26 09:43:20 +02:00
										 |  |  | 			width: childrenRect.width + 4 * Kirigami.Units.smallSpacing; | 
					
						
							| 
									
										
										
										
											2017-06-04 14:40:25 +02:00
										 |  |  | 			height: childrenRect.heigh - Kirigami.Units.smallSpacing; | 
					
						
							| 
									
										
										
										
											2017-07-23 07:54:43 -07:00
										 |  |  | 			anchors.verticalCenter: parent.verticalCenter | 
					
						
							| 
									
										
										
										
											2017-07-22 13:36:54 -07:00
										 |  |  | 			onClicked: { | 
					
						
							|  |  |  | 				console.log("Clicked on the checkbox of item " + index) | 
					
						
							|  |  |  | 				importModel.selectRow(index) | 
					
						
							|  |  |  | 			} | 
					
						
							| 
									
										
										
										
											2017-06-04 14:40:25 +02:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2017-10-12 14:25:22 +02:00
										 |  |  | 		Controls.Label { | 
					
						
							| 
									
										
										
										
											2017-07-23 07:54:43 -07:00
										 |  |  | 			id: dateLabel | 
					
						
							|  |  |  | 			text: innerListItem.datetime | 
					
						
							| 
									
										
										
										
											2017-10-19 15:41:05 +02:00
										 |  |  | 			anchors.verticalCenter: parent.verticalCenter | 
					
						
							| 
									
										
										
										
											2017-07-23 07:54:43 -07:00
										 |  |  | 			width: Math.round(parent.width * 0.35) | 
					
						
							|  |  |  | 			font.pointSize: subsurfaceTheme.smallPointSize | 
					
						
							|  |  |  | 			color: textColor | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2017-10-12 14:25:22 +02:00
										 |  |  | 		Controls.Label { | 
					
						
							| 
									
										
										
										
											2017-07-23 07:54:43 -07:00
										 |  |  | 			text: innerListItem.depth + ' / ' + innerListItem.duration | 
					
						
							| 
									
										
										
										
											2017-10-19 15:41:05 +02:00
										 |  |  | 			anchors.verticalCenter: parent.verticalCenter | 
					
						
							| 
									
										
										
										
											2017-07-23 07:54:43 -07:00
										 |  |  | 			width: Math.round(parent.width * 0.35) | 
					
						
							|  |  |  | 			font.pointSize: subsurfaceTheme.smallPointSize | 
					
						
							|  |  |  | 			color: textColor | 
					
						
							| 
									
										
										
										
											2017-05-29 19:55:36 +02:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } |