| 
									
										
										
										
											2019-02-11 19:34:49 +01:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							|  |  |  | import QtQuick 2.11 | 
					
						
							|  |  |  | import QtQuick.Controls 2.4 | 
					
						
							|  |  |  | import QtQuick.Layouts 1.11 | 
					
						
							| 
									
										
										
										
											2020-05-18 07:22:10 -07:00
										 |  |  | import org.subsurfacedivelog.mobile 1.0 | 
					
						
							|  |  |  | import org.kde.kirigami 2.4 as Kirigami | 
					
						
							| 
									
										
										
										
											2019-02-11 19:34:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | SpinBox { | 
					
						
							| 
									
										
										
										
											2020-01-11 09:03:48 +01:00
										 |  |  | 	id: control | 
					
						
							|  |  |  | 	editable: true | 
					
						
							|  |  |  | 	font.pointSize: subsurfaceTheme.regularPointSize | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	contentItem: TextInput { | 
					
						
							|  |  |  | 		z: 2 | 
					
						
							| 
									
										
										
										
											2024-02-12 17:26:14 -08:00
										 |  |  | 		width: Kirigami.Units.gridUnit * 3 | 
					
						
							| 
									
										
										
										
											2020-01-11 09:03:48 +01:00
										 |  |  | 		text: control.textFromValue(control.value, control.locale) | 
					
						
							|  |  |  | 		font: control.font | 
					
						
							| 
									
										
										
										
											2020-05-18 07:22:10 -07:00
										 |  |  | 		color: control.enabled ? subsurfaceTheme.textColor : subsurfaceTheme.disabledTextColor | 
					
						
							| 
									
										
										
										
											2020-01-11 09:03:48 +01:00
										 |  |  | 		horizontalAlignment: Qt.AlignHCenter | 
					
						
							|  |  |  | 		verticalAlignment: Qt.AlignVCenter | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		readOnly: !control.editable | 
					
						
							|  |  |  | 		validator: control.validator | 
					
						
							|  |  |  | 		inputMethodHints: Qt.ImhFormattedNumbersOnly | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	up.indicator: Rectangle { | 
					
						
							|  |  |  | 		x: control.mirrored ? 0 : parent.width - width | 
					
						
							| 
									
										
										
										
											2024-02-12 17:26:14 -08:00
										 |  |  | 		height: Kirigami.Units.gridUnit * 1.5 | 
					
						
							|  |  |  | 		implicitWidth: Kirigami.Units.gridUnit | 
					
						
							|  |  |  | 		implicitHeight: Kirigami.Units.gridUnit | 
					
						
							| 
									
										
										
										
											2020-05-18 07:22:10 -07:00
										 |  |  | 		color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor | 
					
						
							|  |  |  | 		border.color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor | 
					
						
							| 
									
										
										
										
											2020-01-11 09:03:48 +01:00
										 |  |  | 		Text { | 
					
						
							|  |  |  | 			text: "+" | 
					
						
							| 
									
										
										
										
											2024-02-12 17:26:14 -08:00
										 |  |  | 			font.pixelSize: control.font.pixelSize * 1.5 | 
					
						
							| 
									
										
										
										
											2020-12-22 16:40:16 -08:00
										 |  |  | 			color: control.enabled ? subsurfaceTheme.primaryTextColor : subsurfaceTheme.disabledTextColor | 
					
						
							| 
									
										
										
										
											2020-01-11 09:03:48 +01:00
										 |  |  | 			anchors.fill: parent | 
					
						
							|  |  |  | 			fontSizeMode: Text.Fit | 
					
						
							|  |  |  | 			horizontalAlignment: Text.AlignHCenter | 
					
						
							|  |  |  | 			verticalAlignment: Text.AlignVCenter | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	down.indicator: Rectangle { | 
					
						
							|  |  |  | 		x: control.mirrored ? parent.width - width : 0 | 
					
						
							| 
									
										
										
										
											2024-02-12 17:26:14 -08:00
										 |  |  | 		height: Kirigami.Units.gridUnit * 1.5 | 
					
						
							|  |  |  | 		implicitWidth: Kirigami.Units.gridUnit | 
					
						
							|  |  |  | 		implicitHeight: Kirigami.Units.gridUnit | 
					
						
							| 
									
										
										
										
											2020-05-18 07:22:10 -07:00
										 |  |  | 		color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor | 
					
						
							|  |  |  | 		border.color: control.enabled ? subsurfaceTheme.primaryColor : subsurfaceTheme.backgroundColor | 
					
						
							| 
									
										
										
										
											2020-01-11 09:03:48 +01:00
										 |  |  | 		Text { | 
					
						
							|  |  |  | 			text: "-" | 
					
						
							| 
									
										
										
										
											2024-02-12 17:26:14 -08:00
										 |  |  | 			font.pixelSize: control.font.pixelSize * 1.5 | 
					
						
							| 
									
										
										
										
											2020-12-22 16:40:16 -08:00
										 |  |  | 			color: control.enabled ? subsurfaceTheme.primaryTextColor : subsurfaceTheme.disabledTextColor | 
					
						
							| 
									
										
										
										
											2020-01-11 09:03:48 +01:00
										 |  |  | 			anchors.fill: parent | 
					
						
							|  |  |  | 			fontSizeMode: Text.Fit | 
					
						
							|  |  |  | 			horizontalAlignment: Text.AlignHCenter | 
					
						
							|  |  |  | 			verticalAlignment: Text.AlignVCenter | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	background: Rectangle { | 
					
						
							| 
									
										
										
										
											2020-05-18 07:22:10 -07:00
										 |  |  | 		implicitWidth: 5* Kirigami.Units.gridUnit | 
					
						
							| 
									
										
										
										
											2020-01-11 09:03:48 +01:00
										 |  |  | 		color: subsurfaceTheme.backgroundColor | 
					
						
							|  |  |  | 		border.color: subsurfaceTheme.backgroundColor | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2019-02-11 19:34:49 +01:00
										 |  |  | } |