diff options
author | Jens Bache-Wiig <jens.bache-wiig@nokia.com> | 2012-08-21 18:19:36 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-22 18:40:17 +0200 |
commit | 3591c6ceda4768f7750989b8e603809c37b7d027 (patch) | |
tree | c6b1865fca5cfc386206bfd31cc64f6c2fbd70f0 /src/widgets/styles/qcleanlooksstyle.cpp | |
parent | 05a34203814f60f7693906e7298378330740963e (diff) |
Clean up borders in cleanlooks
This aligns the dockwidget appearance in cleanlooks with
that we use for Gtk style. It should look a lot cleaner this
way as most of the borders were redundant.
Change-Id: Idf20a105f583ca8cdbba0bcb6f22b298d53cc40d
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Diffstat (limited to 'src/widgets/styles/qcleanlooksstyle.cpp')
-rw-r--r-- | src/widgets/styles/qcleanlooksstyle.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/widgets/styles/qcleanlooksstyle.cpp b/src/widgets/styles/qcleanlooksstyle.cpp index c648f74963..92ff9f936d 100644 --- a/src/widgets/styles/qcleanlooksstyle.cpp +++ b/src/widgets/styles/qcleanlooksstyle.cpp @@ -1494,6 +1494,10 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o #endif // QT_NO_SIZEGRIP #ifndef QT_NO_TOOLBAR case CE_ToolBar: + // Reserve the beveled appearance only for mainwindow toolbars + if (!(widget && qobject_cast<const QMainWindow*> (widget->parentWidget()))) + break; + painter->save(); if (const QStyleOptionToolBar *toolbar = qstyleoption_cast<const QStyleOptionToolBar *>(option)) { QRect rect = option->rect; @@ -1599,32 +1603,17 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(dwOpt); bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar; - QRect rect = dwOpt->rect; QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, option, widget); - QRect r = rect.adjusted(0, 0, -1, 0); - if (verticalTitleBar) - r.adjust(0, 0, 0, -1); - painter->setPen(option->palette.light().color()); - painter->drawRect(r.adjusted(1, 1, 1, 1)); - painter->setPen(shadow); - painter->drawRect(r); - if (verticalTitleBar) { + QRect rect = dwOpt->rect; QRect r = rect; QSize s = r.size(); s.transpose(); r.setSize(s); - titleRect = QRect(r.left() + rect.bottom() - titleRect.bottom(), r.top() + titleRect.left() - rect.left(), titleRect.height(), titleRect.width()); - - painter->translate(r.left(), r.top() + r.width()); - painter->rotate(-90); - painter->translate(-r.left(), -r.top()); - - rect = r; } if (!dwOpt->title.isEmpty()) { |