mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	QML UI: move location service to preferences page
Move the locations service switch to the GPS section of the preferences page. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
		
							parent
							
								
									98268a0c7e
								
							
						
					
					
						commit
						e80132cdef
					
				
					 2 changed files with 35 additions and 49 deletions
				
			
		|  | @ -278,6 +278,41 @@ Kirigami.ScrollablePage { | |||
| 				Layout.fillHeight: true | ||||
| 			} | ||||
| 		} | ||||
| 		GridLayout { | ||||
| 			id: locationService | ||||
| 			columns: 2 | ||||
| 			width: parent.width | ||||
| 			CheckBox { | ||||
| 				id: locationCheckbox | ||||
| 				visible: manager.locationServiceAvailable | ||||
| 				checked: manager.locationServiceEnabled | ||||
| 				onClicked: { | ||||
| 					manager.locationServiceEnabled = checked | ||||
| 				} | ||||
| 				indicator: Rectangle { | ||||
| 					implicitWidth: 20 | ||||
| 					implicitHeight: 20 | ||||
| 					x: locationCheckbox.leftPadding | ||||
| 					y: parent.height / 2 - height / 2 | ||||
| 					radius: 4 | ||||
| 					border.color: locationCheckbox.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor | ||||
| 					color: subsurfaceTheme.backgroundColor | ||||
| 
 | ||||
| 					Rectangle { | ||||
| 						width: 12 | ||||
| 						height: 12 | ||||
| 						x: 4 | ||||
| 						y: 4 | ||||
| 						radius: 3 | ||||
| 						color: locationCheckbox.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor | ||||
| 						visible: locationCheckbox.checked | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 			Kirigami.Label { | ||||
| 				text: qsTr("Run location service") | ||||
| 			} | ||||
| 		} | ||||
| 		GridLayout { | ||||
| 			id: libdclogprefs | ||||
| 			columns: 2 | ||||
|  |  | |||
|  | @ -290,55 +290,6 @@ if you have network connectivity and want to sync your data to cloud storage."), | |||
| 			} | ||||
| 		] // end actions | ||||
| 
 | ||||
| 		MouseArea { | ||||
| 			height: childrenRect.height | ||||
| 			width: Kirigami.Units.gridUnit * 10 | ||||
| 			CheckBox { | ||||
| 				//text: qsTr("Run location service") | ||||
| 				id: locationCheckbox | ||||
| 				visible: manager.locationServiceAvailable | ||||
| 				anchors { | ||||
| 					left: parent.left | ||||
| 					top: parent.top | ||||
| 				} | ||||
| 				checked: manager.locationServiceEnabled | ||||
| 				onCheckedChanged: { | ||||
| 					manager.locationServiceEnabled = checked; | ||||
| 				} | ||||
| 				indicator: Rectangle { | ||||
| 					implicitWidth: 20 | ||||
| 					implicitHeight: 20 | ||||
| 					x: locationCheckbox.leftPadding | ||||
| 					y: parent.height / 2 - height / 2 | ||||
| 					radius: 4 | ||||
| 					border.color: locationCheckbox.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor | ||||
| 					color: subsurfaceTheme.drawerColor | ||||
| 
 | ||||
| 					Rectangle { | ||||
| 						width: 12 | ||||
| 						height: 12 | ||||
| 						x: 4 | ||||
| 						y: 4 | ||||
| 						radius: 3 | ||||
| 						color: locationCheckbox.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor | ||||
| 						visible: locationCheckbox && locationCheckbox.checked | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 			Kirigami.Label { | ||||
| 				x: Kirigami.Units.gridUnit * 1.5 | ||||
| 				anchors { | ||||
| 					left: locationCheckbox.right | ||||
| 					//leftMargin: units.smallSpacing | ||||
| 					verticalCenter: locationCheckbox.verticalCenter | ||||
| 				} | ||||
| 				text: Qt.platform.os == "ios" ? "" : manager.locationServiceAvailable ? qsTr("Run location service") : qsTr("No GPS source available") | ||||
| 			} | ||||
| 			onClicked: { | ||||
| 				print("Click.") | ||||
| 				locationCheckbox.checked = !locationCheckbox.checked | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	function blueTheme() { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue