Browse Source

show custom resolution in launcher

Laserlicht 1 month ago
parent
commit
76065fd020
1 changed files with 7 additions and 2 deletions
  1. 7 2
      launcher/settingsView/csettingsview_moc.cpp

+ 7 - 2
launcher/settingsView/csettingsview_moc.cpp

@@ -338,10 +338,17 @@ void CSettingsView::fillValidResolutionsForScreen(int screenIndex)
 	bool fullscreen = settings["video"]["fullscreen"].Bool();
 	bool realFullscreen = settings["video"]["realFullscreen"].Bool();
 
+	int resX = settings["video"]["resolution"]["width"].Integer();
+	int resY = settings["video"]["resolution"]["height"].Integer();
+	QSize currentRes(resX, resY);
+
 	if (!fullscreen || realFullscreen)
 	{
 		QVector<QSize> resolutions = findAvailableResolutions(screenIndex);
 
+		if(!resolutions.contains(currentRes))
+			resolutions.append(currentRes);
+
 		for(const auto & entry : resolutions)
 			ui->comboBoxResolution->addItem(resolutionToString(entry));
 	}
@@ -351,8 +358,6 @@ void CSettingsView::fillValidResolutionsForScreen(int screenIndex)
 	}
 	ui->comboBoxResolution->setEnabled(ui->comboBoxResolution->count() > 1);
 
-	int resX = settings["video"]["resolution"]["width"].Integer();
-	int resY = settings["video"]["resolution"]["height"].Integer();
 	int resIndex = ui->comboBoxResolution->findText(resolutionToString({resX, resY}));
 	ui->comboBoxResolution->setCurrentIndex(resIndex);