summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-07-05 10:05:15 (GMT)
committerSami Merila <sami.merila@nokia.com>2011-07-05 10:05:15 (GMT)
commitedced802d26da8347a827f041561d0e33d79c95e (patch)
treeeea84f5d7fa97592b4c090c4cc82e0d8af5c8f26 /src/gui/styles
parent75346e6df350a040c1c3f91790a3945aa983fbfc (diff)
downloadQt-edced802d26da8347a827f041561d0e33d79c95e.zip
Qt-edced802d26da8347a827f041561d0e33d79c95e.tar.gz
Qt-edced802d26da8347a827f041561d0e33d79c95e.tar.bz2
QS60Style: QMessageBox theme background is incorrect
Use correct native theme graphic for dialog backgrounds. In the past, native menu background graphic was used for dialogs and menus. Task-number: QTBUG-9924 Reviewed-by: Tomi Vihria
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qs60style.cpp10
-rw-r--r--src/gui/styles/qs60style_p.h2
-rw-r--r--src/gui/styles/qs60style_s60.cpp4
3 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index fc5589c..13157ff 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -146,6 +146,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 =
@@ -268,6 +269,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;
@@ -2306,10 +2310,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 586f1f6..10a43e2 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 c88d49a..67181af 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -1196,6 +1196,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.