forked from qt-creator/qt-creator
Flat Theme: Final touches for tool bar separators
To properly support Diana's design, we need a dedicated theme color for the separator. Also, the vertical separators have a certain margin. Change-Id: I4d009342a9320848ec97f5c2d324bfb672650101 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
@@ -275,7 +275,7 @@ void FancyActionBar::paintEvent(QPaintEvent *event)
|
||||
painter.fillRect(event->rect(), StyleHelper::isBaseColorDefault()
|
||||
? creatorTheme()->color(Theme::FancyTabBarBackgroundColor)
|
||||
: StyleHelper::baseColor());
|
||||
painter.setPen(StyleHelper::separatorColor());
|
||||
painter.setPen(creatorTheme()->color(Theme::FancyToolBarSeparatorColor));
|
||||
painter.drawLine(borderRect.topLeft(), borderRect.topRight());
|
||||
} else {
|
||||
painter.setPen(StyleHelper::sidebarShadow());
|
||||
|
||||
@@ -840,7 +840,8 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
// toolbar should draw the top or bottom outline
|
||||
// (needed for the find toolbar for instance)
|
||||
const QColor hightLight = creatorTheme()->widgetStyle() == Theme::StyleDefault
|
||||
? StyleHelper::sidebarHighlight() : StyleHelper::separatorColor();
|
||||
? StyleHelper::sidebarHighlight()
|
||||
: creatorTheme()->color(Theme::FancyToolBarSeparatorColor);
|
||||
const QColor borderColor = drawLightColored
|
||||
? QColor(255, 255, 255, 180) : hightLight;
|
||||
if (widget && widget->property("topBorder").toBool()) {
|
||||
@@ -1018,8 +1019,10 @@ void ManhattanStyle::drawButtonSeparator(QPainter *painter, const QRect &rect, b
|
||||
{
|
||||
const QRectF borderRect = QRectF(rect).adjusted(0.5, 0.5, -0.5, -0.5);
|
||||
if (creatorTheme()->widgetStyle() == Theme::StyleFlat) {
|
||||
painter->setPen(StyleHelper::separatorColor());
|
||||
painter->drawLine(borderRect.topRight(), borderRect.bottomRight());
|
||||
const int margin = 3;
|
||||
painter->setPen(creatorTheme()->color(Theme::FancyToolBarSeparatorColor));
|
||||
painter->drawLine(borderRect.topRight() + QPointF(0, margin),
|
||||
borderRect.bottomRight() - QPointF(0, margin));
|
||||
} else {
|
||||
QLinearGradient grad(rect.topRight(), rect.bottomRight());
|
||||
grad.setColorAt(0, QColor(255, 255, 255, 20));
|
||||
|
||||
Reference in New Issue
Block a user