mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	QML UI: Download from DC: smaller font for connection
Also style all three drop downs the same (otherwise the left edge of the text doesn't align). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									025efc12d4
								
							
						
					
					
						commit
						0104d7444e
					
				
					 2 changed files with 58 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -69,6 +69,24 @@ Kirigami.Page {
 | 
			
		|||
				Layout.fillWidth: true
 | 
			
		||||
				model: vendorList
 | 
			
		||||
				currentIndex: parent.vendoridx
 | 
			
		||||
				delegate: ItemDelegate {
 | 
			
		||||
					width: comboVendor.width
 | 
			
		||||
					contentItem: Text {
 | 
			
		||||
						text: modelData
 | 
			
		||||
						font.pointSize: subsurfaceTheme.regularPointSize
 | 
			
		||||
						verticalAlignment: Text.AlignVCenter
 | 
			
		||||
						elide: Text.ElideRight
 | 
			
		||||
					}
 | 
			
		||||
					highlighted: comboVendor.highlightedIndex === index
 | 
			
		||||
				}
 | 
			
		||||
				contentItem: Text {
 | 
			
		||||
					text: comboVendor.displayText
 | 
			
		||||
					font.pointSize: subsurfaceTheme.regularPointSize
 | 
			
		||||
					leftPadding: Kirigami.Units.gridUnit * 0.5
 | 
			
		||||
					horizontalAlignment: Text.AlignLeft
 | 
			
		||||
					verticalAlignment: Text.AlignVCenter
 | 
			
		||||
					elide: Text.ElideRight
 | 
			
		||||
				}
 | 
			
		||||
				onCurrentTextChanged: {
 | 
			
		||||
					comboProduct.model = downloadThread.data().getProductListFromVendor(currentText)
 | 
			
		||||
					if (currentIndex == downloadThread.data().getDetectedVendorIndex(currentText))
 | 
			
		||||
| 
						 | 
				
			
			@ -82,6 +100,24 @@ Kirigami.Page {
 | 
			
		|||
				Layout.fillWidth: true
 | 
			
		||||
				model: null
 | 
			
		||||
				currentIndex: productidx
 | 
			
		||||
				delegate: ItemDelegate {
 | 
			
		||||
					width: comboProduct.width
 | 
			
		||||
					contentItem: Text {
 | 
			
		||||
						text: modelData
 | 
			
		||||
						font.pointSize: subsurfaceTheme.regularPointSize
 | 
			
		||||
						verticalAlignment: Text.AlignVCenter
 | 
			
		||||
						elide: Text.ElideRight
 | 
			
		||||
					}
 | 
			
		||||
					highlighted: comboProduct.highlightedIndex === index
 | 
			
		||||
				}
 | 
			
		||||
				contentItem: Text {
 | 
			
		||||
					text: comboProduct.displayText
 | 
			
		||||
					font.pointSize: subsurfaceTheme.regularPointSize
 | 
			
		||||
					leftPadding: Kirigami.Units.gridUnit * 0.5
 | 
			
		||||
					horizontalAlignment: Text.AlignLeft
 | 
			
		||||
					verticalAlignment: Text.AlignVCenter
 | 
			
		||||
					elide: Text.ElideRight
 | 
			
		||||
				}
 | 
			
		||||
				onCurrentTextChanged: {
 | 
			
		||||
					var newIdx = downloadThread.data().getMatchingAddress(comboVendor.currentText, currentText)
 | 
			
		||||
					if (newIdx != -1)
 | 
			
		||||
| 
						 | 
				
			
			@ -98,6 +134,25 @@ Kirigami.Page {
 | 
			
		|||
				Layout.fillWidth: true
 | 
			
		||||
				model: connectionListModel
 | 
			
		||||
				currentIndex: -1
 | 
			
		||||
				delegate: ItemDelegate {
 | 
			
		||||
					width: comboConnection.width
 | 
			
		||||
					contentItem: Text {
 | 
			
		||||
						text: modelData
 | 
			
		||||
						// color: "#21be2b"
 | 
			
		||||
						font.pointSize: subsurfaceTheme.smallPointSize
 | 
			
		||||
						verticalAlignment: Text.AlignVCenter
 | 
			
		||||
						elide: Text.ElideRight
 | 
			
		||||
					}
 | 
			
		||||
					highlighted: comboConnection.highlightedIndex === index
 | 
			
		||||
				}
 | 
			
		||||
				contentItem: Text {
 | 
			
		||||
					text: comboConnection.displayText
 | 
			
		||||
					font.pointSize: subsurfaceTheme.smallPointSize
 | 
			
		||||
					leftPadding: Kirigami.Units.gridUnit * 0.5
 | 
			
		||||
					horizontalAlignment: Text.AlignLeft
 | 
			
		||||
					verticalAlignment: Text.AlignVCenter
 | 
			
		||||
					elide: Text.ElideRight
 | 
			
		||||
				}
 | 
			
		||||
				onCurrentTextChanged: {
 | 
			
		||||
					// pattern that matches BT addresses
 | 
			
		||||
					var btAddr = /[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]/ ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -377,8 +377,9 @@ if you have network connectivity and want to sync your data to cloud storage."),
 | 
			
		|||
 | 
			
		||||
	QtObject {
 | 
			
		||||
		id: subsurfaceTheme
 | 
			
		||||
		property int titlePointSize: Math.round(fontMetrics.font.pointSize * 1.5)
 | 
			
		||||
		property int smallPointSize: Math.round(fontMetrics.font.pointSize * 0.8)
 | 
			
		||||
		property int regularPointSize: fontMetrics.font.pointSize
 | 
			
		||||
		property int titlePointSize: Math.round(regularPointSize * 1.5)
 | 
			
		||||
		property int smallPointSize: Math.round(regularPointSize * 0.8)
 | 
			
		||||
 | 
			
		||||
		// colors currently in use
 | 
			
		||||
		property string currentTheme
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue