diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp index 887b3f201ef6fd686ab4bd0cb2d3ebe378f2e062..7be8e7f4b81dffff28124facfb9a88075535d03d 100644 --- a/src/libs/utils/stylehelper.cpp +++ b/src/libs/utils/stylehelper.cpp @@ -147,18 +147,19 @@ void StyleHelper::setBaseColor(const QColor &color) static void verticalGradientHelper(QPainter *p, const QRect &spanRect, const QRect &rect, bool lightColored) { - QColor base = StyleHelper::baseColor(lightColored); QColor highlight = StyleHelper::highlightColor(lightColored); QColor shadow = StyleHelper::shadowColor(lightColored); QLinearGradient grad(spanRect.topRight(), spanRect.topLeft()); - grad.setColorAt(0, highlight); - grad.setColorAt(0.301, base); - grad.setColorAt(1, shadow); + grad.setColorAt(0, highlight.lighter(106)); + grad.setColorAt(1, shadow.darker(106)); p->fillRect(rect, grad); QColor light(255, 255, 255, 80); p->setPen(light); p->drawLine(rect.topRight() - QPoint(1, 0), rect.bottomRight() - QPoint(1, 0)); + QColor dark(0, 0, 0, 90); + p->setPen(dark); + p->drawLine(rect.topLeft(), rect.bottomLeft()); } void StyleHelper::verticalGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect, bool lightColored) diff --git a/src/plugins/coreplugin/fancyactionbar.cpp b/src/plugins/coreplugin/fancyactionbar.cpp index 6afad800145e2be9b07e99456f57d832edc9c798..e9c84538745e87d99db0f72277e1b3a5ffd2dc4b 100644 --- a/src/plugins/coreplugin/fancyactionbar.cpp +++ b/src/plugins/coreplugin/fancyactionbar.cpp @@ -104,7 +104,6 @@ void FancyToolButton::paintEvent(QPaintEvent *event) painter.drawLine(rect().topLeft(), rect().topRight()); painter.drawLine(rect().bottomLeft(), rect().bottomRight()); painter.restore(); - } else #endif if (isDown() || isChecked()) { @@ -193,7 +192,7 @@ void FancyActionBar::paintEvent(QPaintEvent *event) painter.setPen(dark); painter.drawLine(rect().topLeft(), rect().topRight()); painter.setPen(light); - painter.drawLine(rect().topLeft() + QPoint(0,1), rect().topRight() + QPoint(0,1)); + painter.drawLine(rect().topLeft() + QPoint(1,1), rect().topRight() + QPoint(0,1)); } QSize FancyToolButton::sizeHint() const diff --git a/src/plugins/coreplugin/fancytabwidget.cpp b/src/plugins/coreplugin/fancytabwidget.cpp index aba60f9ea389dba837ba9d5de17943b94d8fea0b..6cb520b4628fc04a231f09fdd114c36d5da18af5 100644 --- a/src/plugins/coreplugin/fancytabwidget.cpp +++ b/src/plugins/coreplugin/fancytabwidget.cpp @@ -242,31 +242,30 @@ void FancyTabBar::paintTab(QPainter *painter, int tabIndex) const if (selected) { //background - painter->fillRect(rect, QColor(220, 220, 220)); - - //highlight - painter->setPen(QColor(255, 255, 255, 150)); - painter->drawLine(rect.bottomLeft() - QPoint(-1, 1), rect.bottomRight() - QPoint(0,1)); - painter->drawLine(rect.topRight(), rect.bottomRight()); - - //shadow - painter->setPen(QColor(255, 255, 255, 50)); - painter->drawLine(rect.topLeft() - QPoint(0,2), rect.topRight() - QPoint(0,2)); - painter->setPen(QColor(0, 0, 0, 150)); - painter->drawLine(rect.topLeft() - QPoint(0,1), rect.topRight() - QPoint(0,1)); - painter->drawLine(rect.topLeft(), rect.bottomLeft()); - painter->setPen(QColor(0, 0, 0, 100)); - painter->drawLine(rect.topLeft(), rect.topRight()); - painter->setPen(QColor(0, 0, 0, 40)); - painter->drawLine(rect.topLeft() + QPoint(0,1), rect.topRight() + QPoint(0,1)); - painter->drawLine(rect.topLeft() + QPoint(1,1), rect.bottomLeft() + QPoint(1,0)); - painter->setPen(QColor(0, 0, 0, 20)); - painter->drawLine(rect.topLeft() + QPoint(0,2), rect.topRight() + QPoint(0,2)); - painter->drawLine(rect.topLeft() + QPoint(2,1), rect.bottomLeft() + QPoint(2,0)); - painter->setPen(QColor(0, 0, 0, 150)); + painter->save(); + QLinearGradient grad(rect.topLeft(), rect.topRight()); + grad.setColorAt(0, QColor(255, 255, 255, 160)); + grad.setColorAt(1, QColor(255, 255, 255, 210)); + painter->fillRect(rect.adjusted(0, 0, 0, -1), grad); + painter->restore(); + + //shadows + painter->setPen(QColor(0, 0, 0, 110)); + painter->drawLine(rect.topLeft() + QPoint(1,-1), rect.topRight() - QPoint(0,1)); painter->drawLine(rect.bottomLeft(), rect.bottomRight()); - painter->setPen(QColor(255, 255, 255, 50)); - painter->drawLine(rect.bottomLeft() + QPoint(0,1), rect.bottomRight() + QPoint(0,1)); + painter->setPen(QColor(0, 0, 0, 40)); + painter->drawLine(rect.topLeft(), rect.bottomLeft()); + painter->setPen(QColor(0, 0, 0, 10)); + painter->drawLine(rect.topLeft() + QPoint(1, 1), rect.bottomLeft() + QPoint(1, -1)); + + //highlights + painter->setPen(QColor(255, 255, 255, 90)); + painter->drawLine(rect.topLeft() + QPoint(1, -2), rect.topRight() - QPoint(0,2)); + painter->drawLine(rect.bottomLeft() + QPoint(1, 1), rect.bottomRight() + QPoint(0,1)); + painter->setPen(QColor(255, 255, 255, 160)); + painter->drawLine(rect.topLeft() + QPoint(1, 0), rect.topRight()); + painter->drawLine(rect.topRight() + QPoint(0, 1), rect.bottomRight() - QPoint(0, 1)); + painter->drawLine(rect.bottomLeft() + QPoint(1,-1), rect.bottomRight()-QPoint(0,1)); } QString tabText(this->tabText(tabIndex)); @@ -458,6 +457,9 @@ void FancyTabWidget::paintEvent(QPaintEvent *event) QColor light = Utils::StyleHelper::sidebarHighlight(); painter.setPen(light); painter.drawLine(rect.bottomLeft(), rect.bottomRight()); + painter.setPen(QColor(0, 0, 0, 20)); + painter.drawLine(rect.topLeft() + QPoint(1, 0), rect.bottomLeft() + QPoint(1, 0)); + setContentsMargins(0, 0, 0, 1); } diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 67ba51ade4557e7c8f03820cf1bd295d02fea44d..559026335c73e49b38461cf240a2161b1c62bd82 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -56,6 +56,7 @@ #include <QtGui/QStyleOption> #include <QtGui/QToolBar> #include <QtGui/QToolButton> +#include <QtGui/QAbstractItemView> // We define a currently unused state for indicating animations #define State_Animating 0x00000040 @@ -87,6 +88,7 @@ bool panelWidget(const QWidget *widget) while (p) { if (qobject_cast<const QToolBar *>(p) || qobject_cast<const QStatusBar *>(p) || + qobject_cast<const QAbstractItemView *>(p) || qobject_cast<const QMenuBar *>(p)) return styleEnabled(widget); if (p->property("panelwidget").toBool()) @@ -497,6 +499,25 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption } switch (element) { + case PE_PanelItemViewItem: + if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) { + if (vopt->state & State_Selected) { + QLinearGradient gradient; + gradient.setStart(option->rect.topLeft()); + gradient.setFinalStop(option->rect.bottomRight()); + gradient.setColorAt(0, option->palette.highlight().color().lighter(115)); + gradient.setColorAt(1, option->palette.highlight().color().darker(135)); + painter->fillRect(option->rect, Qt::blue); + } else { + if (vopt->backgroundBrush.style() != Qt::NoBrush) { + QPointF oldBO = painter->brushOrigin(); + painter->setBrushOrigin(vopt->rect.topLeft()); + painter->fillRect(vopt->rect, vopt->backgroundBrush); + painter->setBrushOrigin(oldBO); + } + } + } + break; case PE_PanelLineEdit: { painter->save(); diff --git a/src/plugins/coreplugin/progressmanager/progresspie.cpp b/src/plugins/coreplugin/progressmanager/progresspie.cpp index 45aa71eac84fe5a2271e2fc2e7dce62564bbae64..a469945acfd2731cc0fda5f61310a3dbf227b779 100644 --- a/src/plugins/coreplugin/progressmanager/progresspie.cpp +++ b/src/plugins/coreplugin/progressmanager/progresspie.cpp @@ -150,7 +150,7 @@ void ProgressBar::paintEvent(QPaintEvent *) p.drawLine(0,0, size().width(), 0); p.setPen(Utils::StyleHelper::sidebarHighlight()); - p.drawLine(0, 1, size().width(), 1); + p.drawLine(1, 1, size().width(), 1); QRect textRect = rect().adjusted(0, 0, -1, 0); textRect.setHeight(h+5);