f53df7da64
Code submissions have continually suffered from formatting inconsistencies that constantly have to be addressed. Using clang-format simplifies this by making code formatting more consistent, and allows automation of the code formatting so that maintainers can focus more on the code itself instead of code formatting.
39 lines
905 B
C++
39 lines
905 B
C++
#pragma once
|
|
|
|
#include <QWidget>
|
|
#include <obs.hpp>
|
|
|
|
#define GREY_COLOR_BACKGROUND 0xFF4C4C4C
|
|
|
|
class OBSQTDisplay : public QWidget {
|
|
Q_OBJECT
|
|
Q_PROPERTY(QColor displayBackgroundColor MEMBER backgroundColor READ
|
|
GetDisplayBackgroundColor WRITE
|
|
SetDisplayBackgroundColor)
|
|
|
|
OBSDisplay display;
|
|
|
|
void CreateDisplay();
|
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
signals:
|
|
void DisplayCreated(OBSQTDisplay *window);
|
|
void DisplayResized();
|
|
|
|
public:
|
|
OBSQTDisplay(QWidget *parent = nullptr,
|
|
Qt::WindowFlags flags = nullptr);
|
|
|
|
virtual QPaintEngine *paintEngine() const override;
|
|
|
|
inline obs_display_t *GetDisplay() const { return display; }
|
|
|
|
uint32_t backgroundColor = GREY_COLOR_BACKGROUND;
|
|
|
|
QColor GetDisplayBackgroundColor() const;
|
|
void SetDisplayBackgroundColor(const QColor &color);
|
|
void UpdateDisplayBackgroundColor();
|
|
};
|