Commit b0c8a68a authored by Alessandro Portale's avatar Alessandro Portale

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: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
parent f25bd123
......@@ -41,6 +41,7 @@ DoubleTabWidget2ndTabActiveTextColor=text
DoubleTabWidget2ndTabBackgroundColor=ff434343
DoubleTabWidget2ndTabInactiveTextColor=textDisabled
EditorPlaceholderColor=normalBackground
FancyToolBarSeparatorColor=43ffffff
FancyTabBarBackgroundColor=shadowBackground
FancyTabWidgetDisabledSelectedTextColor=textDisabled
FancyTabWidgetDisabledUnselectedTextColor=textDisabled
......
......@@ -42,6 +42,7 @@ DoubleTabWidget2ndTabActiveTextColor=text
DoubleTabWidget2ndTabBackgroundColor=ff434343
DoubleTabWidget2ndTabInactiveTextColor=textDisabled
EditorPlaceholderColor=normalBackground
FancyToolBarSeparatorColor=43ffffff
FancyTabBarBackgroundColor=shadowBackground
FancyTabWidgetDisabledSelectedTextColor=toolBarItemDisabled
FancyTabWidgetDisabledUnselectedTextColor=toolBarItemDisabled
......
......@@ -145,11 +145,6 @@ QColor StyleHelper::borderColor(bool lightColored)
return result;
}
QColor StyleHelper::separatorColor()
{
return borderColor(false);
}
// We try to ensure that the actual color used are within
// reasonalbe bounds while generating the actual baseColor
// from the users request.
......
......@@ -61,7 +61,6 @@ public:
static QColor highlightColor(bool lightColored = false);
static QColor shadowColor(bool lightColored = false);
static QColor borderColor(bool lightColored = false);
static QColor separatorColor();
static QColor buttonTextColor() { return QColor(0x4c4c4c); }
static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50);
......
......@@ -80,6 +80,7 @@ public:
DoubleTabWidget2ndTabBackgroundColor,
DoubleTabWidget2ndTabInactiveTextColor,
EditorPlaceholderColor,
FancyToolBarSeparatorColor,
FancyTabBarBackgroundColor,
FancyTabWidgetDisabledSelectedTextColor,
FancyTabWidgetDisabledUnselectedTextColor,
......
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment