Qt/WrapInScrollArea: Make background color more consistent

This commit is contained in:
spycrab 2018-05-02 20:08:46 +02:00
parent 54a6b0f50a
commit b741ef81bd
1 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@
#include <QFrame>
#include <QLayout>
#include <QPalette>
#include <QScrollArea>
#include <QVBoxLayout>
#include <QWidget>
@ -29,6 +30,12 @@ QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize, int margi
std::max(recommended_height, to_resize->height()));
}
// Make sure the background color stays consistent with the parent widget
QPalette p = wrapped_widget->palette();
p.setColor(QPalette::Window, QColor(0, 0, 0, 0));
wrapped_widget->setPalette(p);
scroll->setPalette(p);
return scroll;
}