diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2010-02-19 18:05:42 +0100 |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2010-02-22 14:38:18 +0100 |
commit | f331f3322bb9752d7d24896a0d51eada67ca6d98 (patch) | |
tree | 52ade50380aa664e955c4d4ce18b31a0bc64cf5f /src/plugins/coreplugin/fancytabwidget.cpp | |
parent | b90cd35b6ff60b50e2edd667a367cef779fc135e (diff) | |
download | qt-creator-f331f3322bb9752d7d24896a0d51eada67ca6d98.tar.gz |
Mor polish for the sidebar
Diffstat (limited to 'src/plugins/coreplugin/fancytabwidget.cpp')
-rw-r--r-- | src/plugins/coreplugin/fancytabwidget.cpp | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/src/plugins/coreplugin/fancytabwidget.cpp b/src/plugins/coreplugin/fancytabwidget.cpp index aba60f9ea3..6cb520b462 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); } |