FancyTabWidget: Ensure a separator between colorbutton and tabbar

Some Themes do not want highlights and shadows in the toolbars. But we
definitely want a separator between FancyColorButton and FancyTabBar.

Change-Id: I24f384514146d664dbb41ef073368a11c79d85b8
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-04-09 23:49:11 +02:00
parent e73a9c1b0d
commit 0235412b34

View File

@@ -404,6 +404,20 @@ public:
emit clicked(ev->button(), ev->modifiers());
}
void paintEvent(QPaintEvent *event)
{
QWidget::paintEvent(event);
// Some Themes do not want highlights and shadows in the toolbars.
// But we definitely want a separator between FancyColorButton and FancyTabBar
if (!creatorTheme()->flag(Theme::DrawToolBarHighlights)) {
QPainter p(this);
p.setPen(StyleHelper::borderColor());
const QRectF innerRect = QRectF(rect()).adjusted(0.5, 0.5, -0.5, -0.5);
p.drawLine(innerRect.bottomLeft(), innerRect.bottomRight());
}
}
signals:
void clicked(Qt::MouseButton button, Qt::KeyboardModifiers modifiers);
};