forked from qt-creator/qt-creator
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:
@@ -404,6 +404,20 @@ public:
|
|||||||
emit clicked(ev->button(), ev->modifiers());
|
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:
|
signals:
|
||||||
void clicked(Qt::MouseButton button, Qt::KeyboardModifiers modifiers);
|
void clicked(Qt::MouseButton button, Qt::KeyboardModifiers modifiers);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user