diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-25 11:33:15 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-25 11:34:13 (GMT) |
commit | f384dd306c022aa70015133be3a7b4d4c8bb1121 (patch) | |
tree | 704187f228bb2f7dbc76c9d72ae51e65388cc853 /src/gui/widgets/qmenubar.cpp | |
parent | f8acf3b9a9398eabef98be7007fd6766574a788a (diff) | |
download | Qt-f384dd306c022aa70015133be3a7b4d4c8bb1121.zip Qt-f384dd306c022aa70015133be3a7b4d4c8bb1121.tar.gz Qt-f384dd306c022aa70015133be3a7b4d4c8bb1121.tar.bz2 |
Make sure we use layoutDirection from the widget and not always the app
Task-number: 259331
Diffstat (limited to 'src/gui/widgets/qmenubar.cpp')
-rw-r--r-- | src/gui/widgets/qmenubar.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index 0967f71..6633f2a 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -132,7 +132,7 @@ QRect QMenuBarPrivate::menuRect(bool extVisible) const result.adjust(hmargin, 0, -hmargin, 0); if (extVisible) { - if (q->layoutDirection() == Qt::RightToLeft) + if (q->isRightToLeft()) result.setLeft(result.left() + extension->sizeHint().width()); else result.setWidth(result.width() - extension->sizeHint().width()); @@ -140,7 +140,7 @@ QRect QMenuBarPrivate::menuRect(bool extVisible) const if (leftWidget && leftWidget->isVisible()) { QSize sz = leftWidget->sizeHint(); - if (q->layoutDirection() == Qt::RightToLeft) + if (q->isRightToLeft()) result.setRight(result.right() - sz.width()); else result.setLeft(result.left() + sz.width()); @@ -148,7 +148,7 @@ QRect QMenuBarPrivate::menuRect(bool extVisible) const if (rightWidget && rightWidget->isVisible()) { QSize sz = rightWidget->sizeHint(); - if (q->layoutDirection() == Qt::RightToLeft) + if (q->isRightToLeft()) result.setLeft(result.left() + sz.width()); else result.setRight(result.right() - sz.width()); @@ -245,7 +245,7 @@ void QMenuBarPrivate::updateGeometries() pop->addActions(hiddenActions); int vmargin = q->style()->pixelMetric(QStyle::PM_MenuBarVMargin, 0, q); - int x = q->layoutDirection() == Qt::RightToLeft + int x = q->isRightToLeft() ? menuRect.left() - extension->sizeHint().width() + 1 : menuRect.right(); extension->setGeometry(x, vmargin, extension->sizeHint().width(), menuRect.height() - vmargin*2); |