diff options
author | Water-Team <water@pad.test.qt.nokia.com> | 2011-07-05 23:00:16 (GMT) |
---|---|---|
committer | Water-Team <water@pad.test.qt.nokia.com> | 2011-07-05 23:00:16 (GMT) |
commit | 43e116ea63ffd96d945fbaabeafb2374e5f18e9e (patch) | |
tree | 52de6bdb9812b6b98aef7092d1530ea3cb3fb867 /src/gui | |
parent | 9ef422955154199e6f2d5569cb4074a5967f53e9 (diff) | |
parent | 74d8577f5b71a593a968d0723aaca19a5249b7d3 (diff) | |
download | Qt-43e116ea63ffd96d945fbaabeafb2374e5f18e9e.zip Qt-43e116ea63ffd96d945fbaabeafb2374e5f18e9e.tar.gz Qt-43e116ea63ffd96d945fbaabeafb2374e5f18e9e.tar.bz2 |
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qerrormessage.cpp | 16 | ||||
-rw-r--r-- | src/gui/dialogs/qmessagebox.cpp | 11 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 10 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 2 | ||||
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 4 |
5 files changed, 36 insertions, 7 deletions
diff --git a/src/gui/dialogs/qerrormessage.cpp b/src/gui/dialogs/qerrormessage.cpp index 890e6ca..0a6580a 100644 --- a/src/gui/dialogs/qerrormessage.cpp +++ b/src/gui/dialogs/qerrormessage.cpp @@ -249,12 +249,20 @@ QErrorMessage::QErrorMessage(QWidget * parent) d->icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information)); d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop); #endif - grid->addWidget(d->icon, 0, 0, Qt::AlignTop); +#ifdef Q_WS_S60 + //In Symbian, messagebox icons are in LtR UIs on right. Thus, layout needs to switch icon and text columns. + const int preferredIconColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 1 : 0; + const int preferredTextColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 0 : 1; +#else + const int preferredIconColumn = 0; + const int preferredTextColumn = 1; +#endif + grid->addWidget(d->icon, 0, preferredIconColumn, Qt::AlignTop); d->errors = new QErrorMessageTextView(this); - grid->addWidget(d->errors, 0, 1); + grid->addWidget(d->errors, 0, preferredTextColumn); d->again = new QCheckBox(this); d->again->setChecked(true); - grid->addWidget(d->again, 1, 1, Qt::AlignTop); + grid->addWidget(d->again, 1, preferredTextColumn, Qt::AlignTop); d->ok = new QPushButton(this); #ifdef QT_SOFTKEYS_ENABLED d->okAction = new QAction(d->ok); @@ -270,7 +278,7 @@ QErrorMessage::QErrorMessage(QWidget * parent) connect(d->ok, SIGNAL(clicked()), this, SLOT(accept())); d->ok->setFocus(); grid->addWidget(d->ok, 2, 0, 1, 2, Qt::AlignCenter); - grid->setColumnStretch(1, 42); + grid->setColumnStretch(preferredTextColumn, 42); grid->setRowStretch(0, 42); d->retranslateStrings(); } diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index 90ca080..c3a1084 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -259,8 +259,15 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text) QGridLayout *grid = new QGridLayout; #ifndef Q_WS_MAC - grid->addWidget(iconLabel, 0, 0, 2, 1, Qt::AlignTop); - grid->addWidget(label, 0, 1, 1, 1); +#ifdef Q_WS_S60 + const int preferredIconColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 1 : 0; + const int preferredTextColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 0 : 1; +#else + const int preferredIconColumn = 0; + const int preferredTextColumn = 1; +#endif + grid->addWidget(iconLabel, 0, preferredIconColumn, 2, 1, Qt::AlignTop); + grid->addWidget(label, 0, preferredTextColumn, 1, 1); // -- leave space for information label -- grid->addWidget(buttonBox, 2, 0, 1, 2); #else diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index b47b4c8..de45754 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -141,6 +141,7 @@ const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameEleme {SE_Editor, QS60StyleEnums::SP_QsnFrInputCenter}, {SE_TableItemPressed, QS60StyleEnums::SP_QsnFrGridCenterPressed}, {SE_ListItemPressed, QS60StyleEnums::SP_QsnFrListCenterPressed}, + {SE_DialogBackground, QS60StyleEnums::SP_QsnFrPopupCenter}, }; static const int frameElementsCount = @@ -263,6 +264,9 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, case SE_PopupBackground: drawFrame(SF_PopupBackground, painter, rect, flags | SF_PointNorth); break; + case SE_DialogBackground: + drawFrame(SF_DialogBackground, painter, rect, flags | SF_PointNorth); + break; case SE_SettingsList: drawFrame(SF_SettingsList, painter, rect, flags | SF_PointNorth); break; @@ -2261,10 +2265,14 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget) && QS60StylePrivate::equalToThemePalette(option->palette.window().texture().cacheKey(), QPalette::Window)) { const bool comboMenu = qobject_cast<const QComboBoxListView *>(widget); + const bool menu = qobject_cast<const QMenu *>(widget); // Add margin area to the background, to avoid background being cut for first and last item. const int verticalMenuAdjustment = comboMenu ? QS60StylePrivate::pixelMetric(PM_MenuVMargin) : 0; const QRect adjustedMenuRect = option->rect.adjusted(0, -verticalMenuAdjustment, 0, verticalMenuAdjustment); - QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_PopupBackground, painter, adjustedMenuRect, flags); + if (comboMenu || menu) + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_PopupBackground, painter, adjustedMenuRect, flags); + else + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_DialogBackground, painter, adjustedMenuRect, flags); } else { commonStyleDraws = true; } diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index de3cab7..2fa8c7f 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -541,6 +541,7 @@ public: SE_DropArea, SE_TableItemPressed, SE_ListItemPressed, + SE_DialogBackground, }; enum SkinFrameElements { @@ -560,6 +561,7 @@ public: SF_ButtonInactive, SF_TableItemPressed, SF_ListItemPressed, + SF_DialogBackground, }; enum SkinElementFlag { diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 59d5da4..913352a 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1160,6 +1160,10 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme centerId.Set(KAknsIIDQsnFrPopupCenterSubmenu); frameId.Set(KAknsIIDQsnFrPopupSub); break; + case QS60StylePrivate::SF_DialogBackground: + centerId.Set(KAknsIIDQsnFrPopupCenter); + frameId.Set(KAknsIIDQsnFrPopup); + break; case QS60StylePrivate::SF_SettingsList: // Starting from S60_5_3, the root theme has been changed so that KAknsIIDQsnFrSetOpt is empty. // Set the theme ID to None, to avoid theme server trying to draw the empty frame. |