Browse Source

UI: Add default color for the preview background

If custom theme for obs UI has no record about background custom
property in the qss file, then application can set random color per
display initialization. This fixes this issue.
SuslikV 6 years ago
parent
commit
975431a7c7
1 changed files with 3 additions and 1 deletions
  1. 3 1
      UI/qt-display.hpp

+ 3 - 1
UI/qt-display.hpp

@@ -3,6 +3,8 @@
 #include <QWidget>
 #include <QWidget>
 #include <obs.hpp>
 #include <obs.hpp>
 
 
+#define GREY_COLOR_BACKGROUND 0xFF4C4C4C
+
 class OBSQTDisplay : public QWidget {
 class OBSQTDisplay : public QWidget {
 	Q_OBJECT
 	Q_OBJECT
 	Q_PROPERTY(QColor displayBackgroundColor MEMBER backgroundColor
 	Q_PROPERTY(QColor displayBackgroundColor MEMBER backgroundColor
@@ -27,7 +29,7 @@ public:
 
 
 	inline obs_display_t *GetDisplay() const {return display;}
 	inline obs_display_t *GetDisplay() const {return display;}
 
 
-	uint32_t backgroundColor;
+	uint32_t backgroundColor = GREY_COLOR_BACKGROUND;
 
 
 private slots:
 private slots:
 	void SetDisplayBackgroundColor(const QColor &color);
 	void SetDisplayBackgroundColor(const QColor &color);