diff --git a/UI/volume-control.cpp b/UI/volume-control.cpp index 67f98593e..7543d153e 100644 --- a/UI/volume-control.cpp +++ b/UI/volume-control.cpp @@ -531,6 +531,8 @@ VolumeMeter::VolumeMeter(QWidget *parent, obs_volmeter_t *obs_volmeter, bool vertical) : QWidget(parent), obs_volmeter(obs_volmeter), vertical(vertical) { + setAttribute(Qt::WA_OpaquePaintEvent, true); + // Use a font that can be rendered small. tickFont = QFont("Arial"); tickFont.setPixelSize(7); @@ -1041,6 +1043,11 @@ void VolumeMeter::paintEvent(QPaintEvent *event) // Actual painting of the widget starts here. QPainter painter(this); + + // Paint window background color (as widget is opaque) + QColor background = palette().color(QPalette::ColorRole::Window); + painter.fillRect(rect, background); + if (vertical) { // Invert the Y axis to ease the math painter.translate(0, height);