forked from qt-creator/qt-creator
Styling: Merge Qt Simulator theme changes back into Creator.
Reviewed-by: Jens Bache-Wiig
This commit is contained in:
@@ -201,6 +201,14 @@ void StyleHelper::verticalGradient(QPainter *painter, const QRect &spanRect, con
|
|||||||
static void horizontalGradientHelper(QPainter *p, const QRect &spanRect, const
|
static void horizontalGradientHelper(QPainter *p, const QRect &spanRect, const
|
||||||
QRect &rect, bool lightColored)
|
QRect &rect, bool lightColored)
|
||||||
{
|
{
|
||||||
|
if (lightColored) {
|
||||||
|
QLinearGradient shadowGradient(rect.topLeft(), rect.bottomLeft());
|
||||||
|
shadowGradient.setColorAt(0, 0xf0f0f0);
|
||||||
|
shadowGradient.setColorAt(1, 0xcfcfcf);
|
||||||
|
p->fillRect(rect, shadowGradient);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QColor base = StyleHelper::baseColor(lightColored);
|
QColor base = StyleHelper::baseColor(lightColored);
|
||||||
QColor highlight = StyleHelper::highlightColor(lightColored);
|
QColor highlight = StyleHelper::highlightColor(lightColored);
|
||||||
QColor shadow = StyleHelper::shadowColor(lightColored);
|
QColor shadow = StyleHelper::shadowColor(lightColored);
|
||||||
|
|||||||
@@ -795,13 +795,18 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
|||||||
else
|
else
|
||||||
Utils::StyleHelper::verticalGradient(painter, gradientSpan, rect, drawLightColored);
|
Utils::StyleHelper::verticalGradient(painter, gradientSpan, rect, drawLightColored);
|
||||||
|
|
||||||
painter->setPen(Utils::StyleHelper::borderColor());
|
if (!drawLightColored)
|
||||||
|
painter->setPen(Utils::StyleHelper::borderColor());
|
||||||
|
else
|
||||||
|
painter->setPen(QColor(0x888888));
|
||||||
|
|
||||||
if (horizontal) {
|
if (horizontal) {
|
||||||
// Note: This is a hack to determine if the
|
// Note: This is a hack to determine if the
|
||||||
// toolbar should draw the top or bottom outline
|
// toolbar should draw the top or bottom outline
|
||||||
// (needed for the find toolbar for instance)
|
// (needed for the find toolbar for instance)
|
||||||
QColor lighter(Utils::StyleHelper::sidebarHighlight());
|
QColor lighter(Utils::StyleHelper::sidebarHighlight());
|
||||||
|
if (drawLightColored)
|
||||||
|
lighter = QColor(255, 255, 255, 180);
|
||||||
if (widget && widget->property("topBorder").toBool()) {
|
if (widget && widget->property("topBorder").toBool()) {
|
||||||
painter->drawLine(rect.topLeft(), rect.topRight());
|
painter->drawLine(rect.topLeft(), rect.topRight());
|
||||||
painter->setPen(lighter);
|
painter->setPen(lighter);
|
||||||
@@ -817,6 +822,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
QProxyStyle::drawControl(element, option, painter, widget);
|
QProxyStyle::drawControl(element, option, painter, widget);
|
||||||
break;
|
break;
|
||||||
@@ -887,7 +893,8 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
|||||||
}
|
}
|
||||||
tool.rect = tool.rect.adjusted(2, 2, -2, -2);
|
tool.rect = tool.rect.adjusted(2, 2, -2, -2);
|
||||||
drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);
|
drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);
|
||||||
} else if (toolbutton->features & QStyleOptionToolButton::HasMenu) {
|
} else if (toolbutton->features & QStyleOptionToolButton::HasMenu
|
||||||
|
&& !widget->property("noArrow").toBool()) {
|
||||||
int arrowSize = 6;
|
int arrowSize = 6;
|
||||||
QRect ir = toolbutton->rect.adjusted(1, 1, -1, -1);
|
QRect ir = toolbutton->rect.adjusted(1, 1, -1, -1);
|
||||||
QStyleOptionToolButton newBtn = *toolbutton;
|
QStyleOptionToolButton newBtn = *toolbutton;
|
||||||
@@ -968,6 +975,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
|||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
QProxyStyle::drawComplexControl(control, option, painter, widget);
|
QProxyStyle::drawComplexControl(control, option, painter, widget);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user