diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-04 10:44:30 +0200 |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-04 12:56:00 +0200 |
commit | b35d0b78dd9212a1db45b07e63a8ec573ec2ecd7 (patch) | |
tree | c75254e1b9ffb2d07bde2752bd9af463e6d0cf8b /src/gui/styles/qstylesheetstyle.cpp | |
parent | f87b5e49bb3903676a57a69b9bbe1743141926c8 (diff) | |
download | qt4-tools-b35d0b78dd9212a1db45b07e63a8ec573ec2ecd7.tar.gz |
Stylesheet: Do not crop the text in tabs
Because we did not reiimplement SE_TabBarTabText to force the
parentstyle to call the virtual function back, we got the normal style
margins in addition to the one by the stylesheet.
Also added test for !hasNativeBorder to suport cases where we just
specify a border
Reviewed-by: jbache
Task-number: 196326
Diffstat (limited to 'src/gui/styles/qstylesheetstyle.cpp')
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index cead2acb74..3d8dec622e 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -3948,7 +3948,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q QFont oldFont = p->font(); if (subRule.hasFont) p->setFont(subRule.font); - if (subRule.hasBox()) { + if (subRule.hasBox() || !subRule.hasNativeBorder()) { tabCopy.rect = ce == CE_TabBarTabShape ? subRule.borderRect(r) : subRule.contentsRect(r); QWindowsStyle::drawControl(ce, &tabCopy, p, w); @@ -5702,6 +5702,15 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c } break; } + case SE_TabBarTabText: + case SE_TabBarTabLeftButton: + case SE_TabBarTabRightButton: { + QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); + if (subRule.hasBox() || !subRule.hasNativeBorder()) { + return ParentStyle::subElementRect(se, opt, w); + } + break; + } #endif // QT_NO_TABBAR case SE_DockWidgetCloseButton: |