From 3591c6ceda4768f7750989b8e603809c37b7d027 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 21 Aug 2012 18:19:36 +0200 Subject: [PATCH] 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 --- src/widgets/styles/qcleanlooksstyle.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/widgets/styles/qcleanlooksstyle.cpp b/src/widgets/styles/qcleanlooksstyle.cpp index c648f74..92ff9f9 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 (widget->parentWidget()))) + break; + painter->save(); if (const QStyleOptionToolBar *toolbar = qstyleoption_cast(option)) { QRect rect = option->rect; @@ -1599,32 +1603,17 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o = qstyleoption_cast(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()) { -- 2.7.4