summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qcombobox.cpp12
-rw-r--r--src/gui/widgets/qmenu_mac.mm4
2 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index bf0d52b..b1e9c79 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -2449,7 +2449,16 @@ void QComboBox::showPopup()
&& !style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this) && !window()->testAttribute(Qt::WA_DontShowOnScreen))
qScrollEffect(container, scrollDown ? QEffects::DownScroll : QEffects::UpScroll, 150);
#endif
+
+// Don't disable updates on Mac OS X. Windows are displayed immediately on this platform,
+// which means that the window will be visible before the call to container->show() returns.
+// If updates are disabled at this point we'll miss our chance at painting the popup
+// menu before it's shown, causing flicker since the window then displays the standard gray
+// background.
+#ifndef Q_WS_MAC
container->setUpdatesEnabled(false);
+#endif
+
container->raise();
container->show();
container->updateScrollers();
@@ -2460,7 +2469,10 @@ void QComboBox::showPopup()
? QAbstractItemView::PositionAtCenter
: QAbstractItemView::EnsureVisible);
+#ifndef Q_WS_MAC
container->setUpdatesEnabled(updatesEnabled);
+#endif
+
container->update();
#ifdef QT_KEYPAD_NAVIGATION
if (QApplication::keypadNavigationEnabled())
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 8089473..d59e1c9 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -1361,7 +1361,7 @@ QMenuPrivate::QMacMenuPrivate::syncAction(QMacMenuAction *action)
if (!action->action->icon().isNull()
&& action->action->isIconVisibleInMenu()) {
data.iconType = kMenuIconRefType;
- data.iconHandle = (Handle)qt_mac_create_iconref(action->action->icon().pixmap(22, QIcon::Normal));
+ data.iconHandle = (Handle)qt_mac_create_iconref(action->action->icon().pixmap(16, QIcon::Normal));
} else {
data.iconType = kMenuNoIcon;
}
@@ -1400,7 +1400,7 @@ QMenuPrivate::QMacMenuPrivate::syncAction(QMacMenuAction *action)
// Cocoa icon
NSImage *nsimage = 0;
if (!action->action->icon().isNull() && action->action->isIconVisibleInMenu()) {
- nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(action->action->icon().pixmap(22, QIcon::Normal)));
+ nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(action->action->icon().pixmap(16, QIcon::Normal)));
}
[item setImage:nsimage];
[nsimage release];