summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qwindowsxpstyle.cpp
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2011-04-05 09:20:06 (GMT)
committerJens Bache-Wiig <jens.bache-wiig@nokia.com>2011-04-05 09:30:01 (GMT)
commit23dd5cb45547de167f5c2e78554e9c3013e59998 (patch)
tree9a4bd5d29516afff79674a22f84dbf4c0fcab8d8 /src/gui/styles/qwindowsxpstyle.cpp
parentd814e378987348ce2123d083b01ea6fb6c3e6bbf (diff)
downloadQt-23dd5cb45547de167f5c2e78554e9c3013e59998.zip
Qt-23dd5cb45547de167f5c2e78554e9c3013e59998.tar.gz
Qt-23dd5cb45547de167f5c2e78554e9c3013e59998.tar.bz2
QTabWidget/Win: do not add content margin when documentMode enabled
QTabWidget has 2 pixel bottom and right content margin. This removes the margin to maximize the area available for content and improve consistency with other Qt styles when documentMode is enabled. Task-number: QTBUG-15769 Merge-request: 957 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@nokia.com>
Diffstat (limited to 'src/gui/styles/qwindowsxpstyle.cpp')
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 74a20fc..4b2c3a5 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -1196,8 +1196,14 @@ QRect QWindowsXPStyle::subElementRect(SubElement sr, const QStyleOption *option,
if (qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(option))
{
rect = QWindowsStyle::subElementRect(sr, option, widget);
- if (sr == SE_TabWidgetTabContents)
- rect.adjust(0, 0, -2, -2);
+ if (sr == SE_TabWidgetTabContents) {
+ if (const QTabWidget *tabWidget = qobject_cast<const QTabWidget *>(widget)) {
+ if (tabWidget->documentMode())
+ break;
+ }
+
+ rect.adjust(0, 0, -2, -2);
+ }
}
break;
case SE_TabWidgetTabBar: {