فهرست منبع

UI: Fix source toolbar color selection on color source

When selecting a color on the color source, if you pressed cancel, it
would cause it to set the color to black.  Instead, make sure to check
isValid() on the returned color value to see if the user pressed cancel
when selecting a color.
jp9000 5 سال پیش
والد
کامیت
55c21319e0
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 6 1
      UI/context-bar-controls.cpp

+ 6 - 1
UI/context-bar-controls.cpp

@@ -455,7 +455,12 @@ void ColorSourceToolbar::on_choose_clicked()
 	options |= QColorDialog::DontUseNativeDialog;
 #endif
 
-	color = QColorDialog::getColor(color, this, desc, options);
+	QColor newColor = QColorDialog::getColor(color, this, desc, options);
+	if (!newColor.isValid()) {
+		return;
+	}
+
+	color = newColor;
 	UpdateColor();
 
 	obs_data_t *settings = obs_data_create();