diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-04 13:55:19 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-05 18:23:11 (GMT) |
commit | 5727fe3657ee311c7b00e174f662464a67ff59bb (patch) | |
tree | 9dad6288c8576111631323b4e1fb01520f689f43 | |
parent | 5443871a89e01c8d8a8440f7786a24ea87922106 (diff) | |
download | Qt-5727fe3657ee311c7b00e174f662464a67ff59bb.zip Qt-5727fe3657ee311c7b00e174f662464a67ff59bb.tar.gz Qt-5727fe3657ee311c7b00e174f662464a67ff59bb.tar.bz2 |
Add padding around the text in the QTabBar.
This is only usefull when eliding text. We just make SE_TabBarTabText
match to what's computed by QTabBar::tabSizeHint
Reviewed-by: jbache
-rw-r--r-- | src/gui/styles/qcommonstyle.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index f8ae1a6..e1535f8 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -2873,9 +2873,11 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, tr.setRect(0, 0, tr.height(), tr.width()); int verticalShift = pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget); int horizontalShift = pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget); + int hpadding = pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2; + int vpadding = pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2; if (tabV2.shape == QTabBar::RoundedSouth || tabV2.shape == QTabBar::TriangularSouth) verticalShift = -verticalShift; - tr.adjust(0, 0, horizontalShift, verticalShift); + tr.adjust(hpadding, vpadding, horizontalShift - hpadding, verticalShift - vpadding); bool selected = tabV2.state & State_Selected; if (selected) { tr.setBottom(tr.bottom() - verticalShift); |