Allow TitleBarWidget to honour the stylesheet background color

This commit is contained in:
Sergio Martins
2021-09-08 19:35:54 +01:00
parent 0184deb54d
commit c8ca7bf9e1

View File

@@ -236,6 +236,8 @@ void TitleBarWidget::paintEvent(QPaintEvent *)
QPainter p(this);
QStyleOptionDockWidget titleOpt;
titleOpt.init(this);
style()->drawPrimitive(QStyle::PE_Widget, &titleOpt, &p, this);
titleOpt.title = title();
titleOpt.rect = iconRect().isEmpty() ? rect().adjusted(2, 0, -buttonAreaWidth(), 0)
: rect().adjusted(iconRect().right(), 0, -buttonAreaWidth(), 0);