Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions draw-dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void SetAlwaysOnTop(QWidget *window, bool enable)
}
#endif

DrawDock::DrawDock(QWidget *_parent) : QWidget(_parent), eventFilter(BuildEventFilter()), preview(new OBSQTDisplay(this))
DrawDock::DrawDock(QWidget *_parent) : QFrame(_parent), eventFilter(BuildEventFilter()), preview(new OBSQTDisplay(this))
{
auto ml = new QVBoxLayout(this);
ml->setContentsMargins(0, 0, 0, 0);
Expand Down Expand Up @@ -772,7 +772,13 @@ DrawDock::DrawDock(QWidget *_parent) : QWidget(_parent), eventFilter(BuildEventF
#endif

toolbar->addSeparator();
toolbar->addAction(QString::fromUtf8(obs_module_text("Clear")), [this] { ClearDraw(); });
clearAction = toolbar->addAction(QString::fromUtf8(obs_module_text("Clear")), [this] { ClearDraw(); });

// Set object names for theming support
if (auto *colorButton = toolbar->widgetForAction(colorAction))
colorButton->setObjectName(QStringLiteral("drawColorButton"));
if (auto *clearButton = toolbar->widgetForAction(clearAction))
clearButton->setObjectName(QStringLiteral("drawClearButton"));

preview->setObjectName(QStringLiteral("preview"));
preview->setMinimumSize(QSize(24, 24));
Expand Down
4 changes: 3 additions & 1 deletion draw-dock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <QComboBox>
#include <QDockWidget>
#include <QDoubleSpinBox>
#include <QFrame>
#include <QMouseEvent>
#include <QToolBar>

Expand All @@ -22,7 +23,7 @@ class OBSEventFilter : public QObject {
EventFilterFunc filter;
};

class DrawDock : public QWidget {
class DrawDock : public QFrame {
Q_OBJECT
private:
OBSEventFilter *eventFilter;
Expand All @@ -37,6 +38,7 @@ class DrawDock : public QWidget {
QComboBox *toolCombo;
QAction *colorAction;
QAction *imageAction;
QAction *clearAction;
QDoubleSpinBox *toolSizeSpin;
QDoubleSpinBox *alphaSpin;
QCheckBox *eraseCheckbox;
Expand Down