summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-04-10 15:41:47 +0200
committerSergio Ahumada <sergio.ahumada@digia.com>2013-04-10 15:42:22 +0200
commit90297a64f203959f90041887ea31f4bd04bc059a (patch)
tree86f8ad6a5af26fd618cdb2e20601e6df89ac94d6 /src/widgets/dialogs
parent537a4bc4011d32de193dc31caf09a44c1810ab33 (diff)
parentf273d6fbc02055ff3999adc0df76360ca0670435 (diff)
Merge branch 'stable' into dev
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qwizard.cpp12
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp18
2 files changed, 26 insertions, 4 deletions
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 72283451d7..3f214809b4 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -1936,7 +1936,7 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
Here, we call QWizardPage::field() to access the contents of the
\c className field (which was defined in the \c ClassInfoPage)
- and use it to initialize the \c OuputFilePage. The field's
+ and use it to initialize the \c OutputFilePage. The field's
contents is returned as a QVariant.
When we create a field using QWizardPage::registerField(), we
@@ -3131,6 +3131,16 @@ bool QWizard::event(QEvent *event)
d->handleAeroStyleChange();
}
else if (d->isVistaThemeEnabled()) {
+ if (event->type() == QEvent::Resize
+ || event->type() == QEvent::LayoutDirectionChange) {
+ const int buttonLeft = (layoutDirection() == Qt::RightToLeft
+ ? width() - d->vistaHelper->backButton()->sizeHint().width()
+ : 0);
+
+ d->vistaHelper->backButton()->move(buttonLeft,
+ d->vistaHelper->backButton()->y());
+ }
+
d->vistaHelper->mouseEvent(event);
}
#endif
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 001c21da61..b57614c018 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -240,7 +240,11 @@ void QVistaBackButton::paintEvent(QPaintEvent *)
else if (underMouse())
state = WIZ_NAV_BB_HOT;
- pDrawThemeBackground(theme, hdc, WIZ_NAV_BACKBUTTON, state, &clipRect, &clipRect);
+ WIZ_NAVIGATIONPARTS buttonType = (layoutDirection() == Qt::LeftToRight
+ ? WIZ_NAV_BACKBUTTON
+ : WIZ_NAV_FORWARDBUTTON);
+
+ pDrawThemeBackground(theme, hdc, buttonType, state, &clipRect, &clipRect);
}
/******************************************************************************
@@ -385,7 +389,11 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
glowOffset = glowSize();
}
- const QRect textRectangle(titleOffset() - glowOffset, verticalCenter - textHeight / 2, textWidth, textHeight);
+ const int titleLeft = (wizard->layoutDirection() == Qt::LeftToRight
+ ? titleOffset() - glowOffset
+ : wizard->width() - titleOffset() - textWidth + glowOffset);
+
+ const QRect textRectangle(titleLeft, verticalCenter - textHeight / 2, textWidth, textHeight);
if (isWindow) {
drawTitleText(painter, text, textRectangle, hdc);
} else {
@@ -397,7 +405,11 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
const QIcon windowIcon = wizard->windowIcon();
if (!windowIcon.isNull()) {
- const QRect rect(origin.x() + leftMargin(),
+ const int iconLeft = (wizard->layoutDirection() == Qt::LeftToRight
+ ? leftMargin()
+ : wizard->width() - leftMargin() - iconSize());
+
+ const QRect rect(origin.x() + iconLeft,
origin.y() + verticalCenter - iconSize() / 2, iconSize(), iconSize());
const HICON hIcon = qt_pixmapToWinHICON(windowIcon.pixmap(iconSize()));
DrawIconEx(hdc, rect.left(), rect.top(), hIcon, 0, 0, 0, NULL, DI_NORMAL | DI_COMPAT);