mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 08:30:04 +00:00 
			
		
		
		
	Fill in default path when no path is given for theme file
This commit is contained in:
		
							parent
							
								
									6afcf1312f
								
							
						
					
					
						commit
						15f906ad5a
					
				
					 1 changed files with 13 additions and 2 deletions
				
			
		|  | @ -45,6 +45,7 @@ | |||
| #include <QGeoPositionInfo> | ||||
| #include <QPushButton> | ||||
| #include <QStandardItemModel> | ||||
| #include <QStandardPaths> | ||||
| #include <QToolButton> | ||||
| #include <utility> | ||||
| 
 | ||||
|  | @ -585,8 +586,18 @@ void SettingsDialogImpl::SetupGeneralTab() | |||
|       { | ||||
|          const settings::GeneralSettings& generalSettings = | ||||
|             settings::GeneralSettings::Instance(); | ||||
|          const QString file = | ||||
|             generalSettings.theme_file().GetStagedOrValue().c_str(); | ||||
|          QString file = generalSettings.theme_file().GetStagedOrValue().c_str(); | ||||
| 
 | ||||
|          if (file.isEmpty()) | ||||
|          { | ||||
|             const QString appDataPath {QStandardPaths::writableLocation( | ||||
|                QStandardPaths::AppLocalDataLocation)}; | ||||
|             file = appDataPath + "/theme.conf"; | ||||
|             self_->ui->themeFileLineEdit->setText(file); | ||||
|             // setText does not emit the textEdited signal
 | ||||
|             Q_EMIT self_->ui->themeFileLineEdit->textEdited(file); | ||||
|          } | ||||
| 
 | ||||
|          const QPalette palette = | ||||
|             Qt6CT::loadColorScheme(file, QApplication::palette()); | ||||
|          QStyle* style = QApplication::style(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak