summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qtabbar.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-05-04 16:03:02 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-05-04 16:03:02 (GMT)
commitb036e0c3b7c7094c666367000ca05047fc5d1003 (patch)
tree98f56e4def11e11cc52d524cdf7dad4e23dc86e3 /src/gui/widgets/qtabbar.cpp
parentffa103af9620998f47c632f4118e789bf7f1cde7 (diff)
parentc85d2aa7e8d095221e1cc2b4aac2dcd4e9dee775 (diff)
downloadQt-b036e0c3b7c7094c666367000ca05047fc5d1003.zip
Qt-b036e0c3b7c7094c666367000ca05047fc5d1003.tar.gz
Qt-b036e0c3b7c7094c666367000ca05047fc5d1003.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: translations/translations.pri
Diffstat (limited to 'src/gui/widgets/qtabbar.cpp')
-rw-r--r--src/gui/widgets/qtabbar.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 8aaaade..d692307 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -67,6 +67,10 @@
#include <private/qt_cocoa_helpers_mac_p.h>
#endif
+#ifndef QT_NO_STYLE_S60
+#include "qs60style.h"
+#endif
+
QT_BEGIN_NAMESPACE
@@ -490,6 +494,9 @@ void QTabBarPrivate::layoutTabs()
if (useScrollButtons && tabList.count() && last > available) {
int extra = extraWidth();
+#ifndef QT_NO_STYLE_S60
+ QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style());
+#endif
if (!vertTabs) {
Qt::LayoutDirection ld = q->layoutDirection();
QRect arrows = QStyle::visualRect(ld, q->rect(),
@@ -497,25 +504,57 @@ void QTabBarPrivate::layoutTabs()
int buttonOverlap = q->style()->pixelMetric(QStyle::PM_TabBar_ScrollButtonOverlap, 0, q);
if (ld == Qt::LeftToRight) {
+// In S60style, tab scroll buttons are layoutted separately, on the sides of the tabbar.
+#ifndef QT_NO_STYLE_S60
+ if (s60Style) {
+ rightB->setGeometry(arrows.left() + extra / 2, arrows.top(), extra / 2, arrows.height());
+ leftB->setGeometry(0, arrows.top(), extra / 2, arrows.height());
+ } else {
+#endif
leftB->setGeometry(arrows.left(), arrows.top(), extra/2, arrows.height());
rightB->setGeometry(arrows.right() - extra/2 + buttonOverlap, arrows.top(),
extra/2, arrows.height());
+#ifndef QT_NO_STYLE_S60
+ }
+#endif
leftB->setArrowType(Qt::LeftArrow);
rightB->setArrowType(Qt::RightArrow);
} else {
+#ifndef QT_NO_STYLE_S60
+ if (s60Style) {
+ rightB->setGeometry(arrows.left() + extra / 2, arrows.top(), extra / 2, arrows.height());
+ leftB->setGeometry(0, arrows.top(), extra / 2, arrows.height());
+ } else {
+#endif
rightB->setGeometry(arrows.left(), arrows.top(), extra/2, arrows.height());
leftB->setGeometry(arrows.right() - extra/2 + buttonOverlap, arrows.top(),
extra/2, arrows.height());
+#ifndef QT_NO_STYLE_S60
+ }
+#endif
rightB->setArrowType(Qt::LeftArrow);
leftB->setArrowType(Qt::RightArrow);
}
} else {
+#ifndef QT_NO_STYLE_S60
+ if (s60Style) {
+ QRect arrows = QRect(0, 0, size.width(), available );
+ leftB->setGeometry(arrows.left(), arrows.top(), arrows.width(), extra / 2);
+ leftB->setArrowType(Qt::UpArrow);
+ rightB->setGeometry(arrows.left(), arrows.bottom() - extra / 2 + 1,
+ arrows.width(), extra / 2);
+ rightB->setArrowType(Qt::DownArrow);
+ } else {
+#endif
QRect arrows = QRect(0, available - extra, size.width(), extra );
leftB->setGeometry(arrows.left(), arrows.top(), arrows.width(), extra/2);
leftB->setArrowType(Qt::UpArrow);
rightB->setGeometry(arrows.left(), arrows.bottom() - extra/2 + 1,
arrows.width(), extra/2);
rightB->setArrowType(Qt::DownArrow);
+#ifndef QT_NO_STYLE_S60
+ }
+#endif
}
leftB->setEnabled(scrollOffset > 0);
rightB->setEnabled(last - scrollOffset >= available - extra);