Qt/WrapInScrollArea: Make background color more consistent
This commit is contained in:
parent
54a6b0f50a
commit
b741ef81bd
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
#include <QLayout>
|
#include <QLayout>
|
||||||
|
#include <QPalette>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
@ -29,6 +30,12 @@ QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize, int margi
|
||||||
std::max(recommended_height, to_resize->height()));
|
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;
|
return scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue