summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-03-31 11:04:21 (GMT)
committerSami Merila <sami.merila@nokia.com>2011-03-31 11:04:21 (GMT)
commit7da530eba0e53cf0c15e790a395442fc9daa41b0 (patch)
treeae8c16b2d77a0b771e7bbb375b652878bd0ec634 /src
parent7ad2dfdc8e812b115a78742aa95d796cea16665a (diff)
downloadQt-7da530eba0e53cf0c15e790a395442fc9daa41b0.zip
Qt-7da530eba0e53cf0c15e790a395442fc9daa41b0.tar.gz
Qt-7da530eba0e53cf0c15e790a395442fc9daa41b0.tar.bz2
QS60Style: Regression in drawing dialog background
Fix for QTBUG-16858 improved somewhat QComboBox menu drawing, but unfortunately caused regression in QMenu and dialog background drawing. These widgets shouldn't reserve space for PM_MenuVMargin. Task-number: QTBUG-18482 Reviewed-by: Dmitry Trofimov
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qs60style.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 3706033..05243a7 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2282,8 +2282,9 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
//Need extra check since dialogs have their own theme background
if (QS60StylePrivate::canDrawThemeBackground(option->palette.base(), widget)
&& QS60StylePrivate::equalToThemePalette(option->palette.window().texture().cacheKey(), QPalette::Window)) {
+ const bool comboMenu = qobject_cast<const QComboBoxListView *>(widget);
// Add margin area to the background, to avoid background being cut for first and last item.
- const int verticalMenuAdjustment = QS60StylePrivate::pixelMetric(PM_MenuVMargin);
+ 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);
} else {