Commit a0fbfd3b authored by Alessandro Portale's avatar Alessandro Portale

Themes: Make toolbar highlights optional

Following Diana's flat style motto "remove unnecessary lines", this
patch makes highlights and shadows in the toolbars optional, and removes
them for the new flat theme.

"default" and "dark" are not affected by this change.

Change-Id: Iadbbaa669e318406a154fed3e07890fd40f5f621
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent cfaba1a1
......@@ -171,6 +171,7 @@ DrawIndicatorBranch=true
DrawProgressBarSunken=false
DrawSearchResultWidgetFrame=false
DrawTargetSelectorBottom=false
DrawToolBarHighlights=true
ApplyThemePaletteGlobally=true
FlatSideBarIcons=true
FlatProjectsMode=true
......
......@@ -173,6 +173,7 @@ DrawIndicatorBranch=true
DrawProgressBarSunken=false
DrawSearchResultWidgetFrame=false
DrawTargetSelectorBottom=false
DrawToolBarHighlights=false
ApplyThemePaletteGlobally=false
FlatSideBarIcons=true
FlatProjectsMode=false
......
......@@ -165,6 +165,7 @@ DrawIndicatorBranch=false
DrawProgressBarSunken=true
DrawSearchResultWidgetFrame=true
DrawTargetSelectorBottom=true
DrawToolBarHighlights=true
ApplyThemePaletteGlobally=false
FlatSideBarIcons=false
FlatProjectsMode=false
......
......@@ -256,6 +256,7 @@ public:
DrawSearchResultWidgetFrame,
DrawProgressBarSunken,
DrawIndicatorBranch,
DrawToolBarHighlights,
ComboBoxDrawTextShadow,
DerivePaletteFromTheme,
ApplyThemePaletteGlobally,
......
......@@ -830,32 +830,34 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
else
StyleHelper::verticalGradient(painter, gradientSpan, rect, drawLightColored);
if (!drawLightColored)
painter->setPen(StyleHelper::borderColor());
else
painter->setPen(QColor(0x888888));
if (horizontal) {
// Note: This is a hack to determine if the
// toolbar should draw the top or bottom outline
// (needed for the find toolbar for instance)
const QColor hightLight = creatorTheme()->widgetStyle() == Theme::StyleDefault
? StyleHelper::sidebarHighlight()
: creatorTheme()->color(Theme::FancyToolBarSeparatorColor);
const QColor borderColor = drawLightColored
? QColor(255, 255, 255, 180) : hightLight;
if (widget && widget->property("topBorder").toBool()) {
painter->drawLine(borderRect.topLeft(), borderRect.topRight());
painter->setPen(borderColor);
painter->drawLine(borderRect.topLeft() + QPointF(0, 1), borderRect.topRight() + QPointF(0, 1));
if (creatorTheme()->flag(Theme::DrawToolBarHighlights)) {
if (!drawLightColored)
painter->setPen(StyleHelper::borderColor());
else
painter->setPen(QColor(0x888888));
if (horizontal) {
// Note: This is a hack to determine if the
// toolbar should draw the top or bottom outline
// (needed for the find toolbar for instance)
const QColor hightLight = creatorTheme()->widgetStyle() == Theme::StyleDefault
? StyleHelper::sidebarHighlight()
: creatorTheme()->color(Theme::FancyToolBarSeparatorColor);
const QColor borderColor = drawLightColored
? QColor(255, 255, 255, 180) : hightLight;
if (widget && widget->property("topBorder").toBool()) {
painter->drawLine(borderRect.topLeft(), borderRect.topRight());
painter->setPen(borderColor);
painter->drawLine(borderRect.topLeft() + QPointF(0, 1), borderRect.topRight() + QPointF(0, 1));
} else {
painter->drawLine(borderRect.bottomLeft(), borderRect.bottomRight());
painter->setPen(borderColor);
painter->drawLine(borderRect.topLeft(), borderRect.topRight());
}
} else {
painter->drawLine(borderRect.bottomLeft(), borderRect.bottomRight());
painter->setPen(borderColor);
painter->drawLine(borderRect.topLeft(), borderRect.topRight());
painter->drawLine(borderRect.topLeft(), borderRect.bottomLeft());
painter->drawLine(borderRect.topRight(), borderRect.bottomRight());
}
} else {
painter->drawLine(borderRect.topLeft(), borderRect.bottomLeft());
painter->drawLine(borderRect.topRight(), borderRect.bottomRight());
}
}
break;
......
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