qs: use SystemClock.date in clock
This commit is contained in:
		
							parent
							
								
									324d1aad9d
								
							
						
					
					
						commit
						88a355ebe4
					
				
					 1 changed files with 2 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -32,11 +32,7 @@ BarWidgetInner {
 | 
			
		|||
 | 
			
		||||
   		Text {
 | 
			
		||||
   			Layout.alignment: Qt.AlignHCenter
 | 
			
		||||
   			text: {
 | 
			
		||||
   				const hours = clock.hours.toString().padStart(2, '0')
 | 
			
		||||
   				const minutes = clock.minutes.toString().padStart(2, '0')
 | 
			
		||||
   				return `${hours}\n${minutes}`
 | 
			
		||||
   			}
 | 
			
		||||
   			text: Qt.formatDateTime(clock.date, "hh\nmm")
 | 
			
		||||
   			font.pointSize: 18
 | 
			
		||||
   			color: "white"
 | 
			
		||||
   		}
 | 
			
		||||
| 
						 | 
				
			
			@ -52,15 +48,7 @@ BarWidgetInner {
 | 
			
		|||
		Loader {
 | 
			
		||||
			active: tooltip.visible
 | 
			
		||||
			sourceComponent: Label {
 | 
			
		||||
				text: {
 | 
			
		||||
					// SystemClock can send an update slightly (<50ms) before the
 | 
			
		||||
					// time changes. We use its readout so the widget and tooltip match.
 | 
			
		||||
					const hours = clock.hours.toString().padStart(2, '0');
 | 
			
		||||
					const minutes = clock.minutes.toString().padStart(2, '0');
 | 
			
		||||
					const seconds = clock.seconds.toString().padStart(2, '0');
 | 
			
		||||
 | 
			
		||||
					return `${hours}:${minutes}:${seconds}\n` + new Date().toLocaleString(Qt.locale("en_US"), "dddd, MMMM d, yyyy");
 | 
			
		||||
				}
 | 
			
		||||
				text: Qt.formatDateTime(clock.date, "hh:mm:ss\ndddd, MMMM d, yyyy");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue