mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	mobile-widgets: replace qmlprefs::theme with qPrefDisplay::theme
Shortcut and use qPrefDisplay::theme() direct Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
		
							parent
							
								
									51bc41b517
								
							
						
					
					
						commit
						c9122283cc
					
				
					 4 changed files with 4 additions and 28 deletions
				
			
		|  | @ -139,8 +139,7 @@ Kirigami.ScrollablePage { | ||||||
| 				enabled: subsurfaceTheme.currentTheme !== "Blue" | 				enabled: subsurfaceTheme.currentTheme !== "Blue" | ||||||
| 				onClicked: { | 				onClicked: { | ||||||
| 					blueTheme() | 					blueTheme() | ||||||
| 					prefs.theme = subsurfaceTheme.currentTheme | 					PrefDisplay.theme = subsurfaceTheme.currentTheme | ||||||
| 					manager.savePreferences() |  | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  | @ -192,8 +191,7 @@ Kirigami.ScrollablePage { | ||||||
| 				enabled: subsurfaceTheme.currentTheme !== "Pink" | 				enabled: subsurfaceTheme.currentTheme !== "Pink" | ||||||
| 				onClicked: { | 				onClicked: { | ||||||
| 					pinkTheme() | 					pinkTheme() | ||||||
| 					prefs.theme = subsurfaceTheme.currentTheme | 					PrefDisplay.theme = subsurfaceTheme.currentTheme | ||||||
| 					manager.savePreferences() |  | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  | @ -244,8 +242,7 @@ Kirigami.ScrollablePage { | ||||||
| 				enabled: subsurfaceTheme.currentTheme !== "Dark" | 				enabled: subsurfaceTheme.currentTheme !== "Dark" | ||||||
| 				onClicked: { | 				onClicked: { | ||||||
| 					darkTheme() | 					darkTheme() | ||||||
| 					prefs.theme = subsurfaceTheme.currentTheme | 					PrefDisplay.theme = subsurfaceTheme.currentTheme | ||||||
| 					manager.savePreferences() |  | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | @ -506,7 +506,7 @@ if you have network connectivity and want to sync your data to cloud storage."), | ||||||
| 		property int columnWidth: Math.round(rootItem.width/(Kirigami.Units.gridUnit*28)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(Kirigami.Units.gridUnit*28))) : rootItem.width | 		property int columnWidth: Math.round(rootItem.width/(Kirigami.Units.gridUnit*28)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(Kirigami.Units.gridUnit*28))) : rootItem.width | ||||||
| 		Component.onCompleted: { | 		Component.onCompleted: { | ||||||
| 			// this needs to pick the theme from persistent preference settings | 			// this needs to pick the theme from persistent preference settings | ||||||
| 			var theme = prefs.theme | 			var theme = PrefDisplay.theme | ||||||
| 			if (theme == "Blue") | 			if (theme == "Blue") | ||||||
| 				blueTheme() | 				blueTheme() | ||||||
| 			else if (theme == "Pink") | 			else if (theme == "Pink") | ||||||
|  |  | ||||||
|  | @ -108,19 +108,6 @@ void QMLPrefs::setShowPin(bool enable) | ||||||
| 	emit showPinChanged(); | 	emit showPinChanged(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const QString QMLPrefs::theme() const |  | ||||||
| { |  | ||||||
| 	return qPrefDisplay::theme(); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void QMLPrefs::setTheme(QString theme) |  | ||||||
| { |  | ||||||
| 	qPrefDisplay::set_theme(theme); |  | ||||||
| 	emit themeChanged(); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| /*** public slot functions ***/ | /*** public slot functions ***/ | ||||||
| void QMLPrefs::cancelCredentialsPinSetup() | void QMLPrefs::cancelCredentialsPinSetup() | ||||||
| {    | {    | ||||||
|  |  | ||||||
|  | @ -33,10 +33,6 @@ class QMLPrefs : public QObject { | ||||||
| 				MEMBER m_oldStatus | 				MEMBER m_oldStatus | ||||||
| 				WRITE setOldStatus | 				WRITE setOldStatus | ||||||
| 				NOTIFY oldStatusChanged) | 				NOTIFY oldStatusChanged) | ||||||
| 	Q_PROPERTY(QString theme |  | ||||||
| 				READ theme |  | ||||||
| 				WRITE setTheme |  | ||||||
| 				NOTIFY themeChanged) |  | ||||||
| public: | public: | ||||||
| 	QMLPrefs(); | 	QMLPrefs(); | ||||||
| 	~QMLPrefs(); | 	~QMLPrefs(); | ||||||
|  | @ -61,9 +57,6 @@ public: | ||||||
| 	bool showPin() const; | 	bool showPin() const; | ||||||
| 	void setShowPin(bool enable); | 	void setShowPin(bool enable); | ||||||
| 
 | 
 | ||||||
| 	const QString theme() const; |  | ||||||
| 	void setTheme(QString theme); |  | ||||||
| 
 |  | ||||||
| public slots: | public slots: | ||||||
| 	void cancelCredentialsPinSetup(); | 	void cancelCredentialsPinSetup(); | ||||||
| 	void clearCredentials(); | 	void clearCredentials(); | ||||||
|  | @ -84,7 +77,6 @@ signals: | ||||||
| 	void credentialStatusChanged(); | 	void credentialStatusChanged(); | ||||||
| 	void oldStatusChanged(); | 	void oldStatusChanged(); | ||||||
| 	void showPinChanged(); | 	void showPinChanged(); | ||||||
| 	void themeChanged(); |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue