Browse Source

UI: Fix color format warning

bbeafeabdd1c00affa73657a0ac992dd9295fc15 change how the combobox is filled.

`UpdateColorFormatSpaceWarning` did not get the required change to use
the combobox data rather than the text.
tytan652 3 years ago
parent
commit
b65411c343
1 changed files with 5 additions and 5 deletions
  1. 5 5
      UI/window-basic-settings.cpp

+ 5 - 5
UI/window-basic-settings.cpp

@@ -2583,13 +2583,13 @@ void OBSBasicSettings::LoadAudioSettings()
 
 void OBSBasicSettings::UpdateColorFormatSpaceWarning()
 {
-	const QString text = ui->colorFormat->currentText();
+	const QString format = ui->colorFormat->currentData().toString();
 	switch (ui->colorSpace->currentIndex()) {
 	case 3: /* Rec.2100 (PQ) */
 	case 4: /* Rec.2100 (HLG) */
-		if (text == "P010") {
+		if (format == "P010") {
 			ui->advancedMsg2->clear();
-		} else if (text == "I010") {
+		} else if (format == "I010") {
 			ui->advancedMsg2->setText(
 				QTStr("Basic.Settings.Advanced.FormatWarning"));
 		} else {
@@ -2598,9 +2598,9 @@ void OBSBasicSettings::UpdateColorFormatSpaceWarning()
 		}
 		break;
 	default:
-		if (text == "NV12") {
+		if (format == "NV12") {
 			ui->advancedMsg2->clear();
-		} else if ((text == "I010") || (text == "P010")) {
+		} else if ((format == "I010") || (format == "P010")) {
 			ui->advancedMsg2->setText(QTStr(
 				"Basic.Settings.Advanced.FormatWarning10BitSdr"));
 		} else {