Browse Source

UI: Fix bug where color property shows transparency

Technically, setting the transparency value via a color property isn't
currently supported.  However, some sources/filters will set their alpha
portion of their color value to 0, which would cause the color property
to have a transparent background.  Set the alpha value to 255 for now,
at least until we properly implement support for setting transparency
via the color property (if we ever do).
jp9000 7 years ago
parent
commit
78d566916b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      UI/properties-view.cpp

+ 3 - 0
UI/properties-view.cpp

@@ -638,6 +638,8 @@ void OBSPropertiesView::AddColor(obs_property_t *prop, QFormLayout *layout,
 	button->setText(QTStr("Basic.PropertiesWindow.SelectColor"));
 	button->setToolTip(QT_UTF8(obs_property_long_description(prop)));
 
+	color.setAlpha(255);
+
 	QPalette palette = QPalette(color);
 	colorLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
 	colorLabel->setText(color.name(QColor::HexArgb));
@@ -1635,6 +1637,7 @@ bool WidgetInfo::ColorChanged(const char *setting)
 #endif
 
 	color = QColorDialog::getColor(color, view, QT_UTF8(desc), options);
+	color.setAlpha(255);
 
 	if (!color.isValid())
 		return false;