diff options
author | Prasanth Ullattil <prasanth.ulattil@nokia.com> | 2009-10-29 12:46:45 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ulattil@nokia.com> | 2009-10-29 12:46:45 (GMT) |
commit | 9551b8c349ce4e15a57c24a2408ee1b73c2b7510 (patch) | |
tree | f4d34204428bafe8fcf68327677212401fd8396b /src/gui/styles | |
parent | b1f9882fa52745c922eb0109daa011908214dcf7 (diff) | |
download | Qt-9551b8c349ce4e15a57c24a2408ee1b73c2b7510.zip Qt-9551b8c349ce4e15a57c24a2408ee1b73c2b7510.tar.gz Qt-9551b8c349ce4e15a57c24a2408ee1b73c2b7510.tar.bz2 |
Tabs with corner widgets are drawn incorrectly in document mode on Mac.
While drawing the tabbar frame, mac style needs the QTabBar pointer to
calculate the correct size.
Since the QTabWidget also uses the PE_FrameTabBarBase to draw background
of the corner widgets, the mac style has to use position passed with the
style option. This only works with horizontal tabs.
Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 4dcb469..38c3feb 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -342,12 +342,12 @@ void drawTabBase(QPainter *p, const QStyleOptionTabBarBaseV2 *tbb, const QWidget borderHighlightTop = QColor(207, 207, 207); } p->setPen(borderHighlightTop); - p->drawLine(0, 0, width, 0); + p->drawLine(tabRect.x(), 0, width, 0); p->setPen(borderTop); - p->drawLine(0, 1, width, 1); + p->drawLine(tabRect.x(), 1, width, 1); // center block - QRect centralRect(0, 2, width, height - 2); + QRect centralRect(tabRect.x(), 2, width, height - 2); if (active) { QColor mainColor = QColor(120, 120, 120); p->fillRect(centralRect, mainColor); @@ -370,9 +370,9 @@ void drawTabBase(QPainter *p, const QStyleOptionTabBarBaseV2 *tbb, const QWidget borderBottom = QColor(127, 127, 127); } p->setPen(borderHighlightBottom); - p->drawLine(0, height - 2, width, height - 2); + p->drawLine(tabRect.x(), height - 2, width, height - 2); p->setPen(borderBottom); - p->drawLine(0, height - 1, width, height - 1); + p->drawLine(tabRect.x(), height - 1, width, height - 1); } /* |