Skip to content

Commit 130514f

Browse files
committed
Remove background color methods
When the class name was `OBSQTDisplay`, the background color was automatically configured from the style sheet. Since the previous commit changes the class name, we not longer need to define these method to configure the background color.
1 parent 2e731d4 commit 130514f

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

include/NorisQTDisplay.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737

3838
class NORISCOMMONUI_EXPORT NorisQTDisplay : public QWidget {
3939
Q_OBJECT
40-
Q_PROPERTY(QColor displayBackgroundColor MEMBER backgroundColor READ GetDisplayBackgroundColor WRITE
41-
SetDisplayBackgroundColor)
4240

4341
struct private_data_s &priv;
4442

@@ -59,8 +57,6 @@ class NORISCOMMONUI_EXPORT NorisQTDisplay : public QWidget {
5957

6058
obs_display_t *GetDisplay() const;
6159

62-
QColor GetDisplayBackgroundColor() const;
63-
void SetDisplayBackgroundColor(const QColor &color);
6460
void CreateDisplay();
6561
void DestroyDisplay();
6662

src/NorisQTDisplay.cpp

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,10 @@
4646

4747
#include "moc_NorisQTDisplay.cpp"
4848

49-
#define GREY_COLOR_BACKGROUND 0xFF4C4C4C
49+
#define DEFAULT_BACKGROUND_COLOR 0xFF000000
5050

5151
struct private_data_s {
5252
OBSDisplay display;
53-
uint32_t backgroundColor = GREY_COLOR_BACKGROUND;
54-
void UpdateDisplayBackgroundColor();
5553
};
5654

5755
static inline long long color_to_int(const QColor &color)
@@ -159,26 +157,6 @@ obs_display_t *NorisQTDisplay::GetDisplay() const
159157
return priv.display;
160158
}
161159

162-
QColor NorisQTDisplay::GetDisplayBackgroundColor() const
163-
{
164-
return rgba_to_color(priv.backgroundColor);
165-
}
166-
167-
void NorisQTDisplay::SetDisplayBackgroundColor(const QColor &color)
168-
{
169-
uint32_t newBackgroundColor = (uint32_t)color_to_int(color);
170-
171-
if (newBackgroundColor != priv.backgroundColor) {
172-
priv.backgroundColor = newBackgroundColor;
173-
priv.UpdateDisplayBackgroundColor();
174-
}
175-
}
176-
177-
void private_data_s::UpdateDisplayBackgroundColor()
178-
{
179-
obs_display_set_background_color(display, backgroundColor);
180-
}
181-
182160
void NorisQTDisplay::CreateDisplay()
183161
{
184162
if (priv.display)
@@ -198,7 +176,7 @@ void NorisQTDisplay::CreateDisplay()
198176
if (!QTToGSWindow(windowHandle(), info.window))
199177
return;
200178

201-
priv.display = obs_display_create(&info, priv.backgroundColor);
179+
priv.display = obs_display_create(&info, DEFAULT_BACKGROUND_COLOR);
202180

203181
emit DisplayCreated(this);
204182
}

0 commit comments

Comments
 (0)