summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-28 08:56:44 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-28 08:58:49 +0200
commitbe35b70ca1bf61d022f7dee9df4aaccbf715b25e (patch)
treedd59ae3713b2bc516101f921491292a8b2c295e3 /src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
parentcc54161abb977751b4499c559fc0f464b9e2399e (diff)
parent572200989b224ad68e7b8ae4c0aecceb6ca871a2 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index 4002d61318..75a33cbda3 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -100,6 +100,11 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
mDialogIsExecuting = false;
mResultSet = false;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7)
+ [mColorPanel setRestorable:NO];
+#endif
+
if (mHelper->options()->testOption(QColorDialogOptions::NoButtons)) {
mStolenContentView = 0;
mOkButton = 0;
@@ -276,6 +281,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
- (void)showModelessPanel
{
mDialogIsExecuting = false;
+ mResultSet = false;
[mColorPanel makeKeyAndOrderFront:mColorPanel];
}
@@ -369,10 +375,8 @@ void QCocoaColorDialogHelper::exec()
bool QCocoaColorDialogHelper::show(Qt::WindowFlags, Qt::WindowModality windowModality, QWindow *parent)
{
- if (windowModality == Qt::WindowModal) {
- // Cocoa's shared color panel cannot be shown as a sheet
- return false;
- }
+ if (windowModality == Qt::WindowModal)
+ windowModality = Qt::ApplicationModal;
return showCocoaColorPanel(windowModality, parent);
}
@@ -435,9 +439,9 @@ bool QCocoaColorDialogHelper::showCocoaColorPanel(Qt::WindowModality windowModal
createNSColorPanelDelegate();
QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
[delegate->mColorPanel setShowsAlpha:options()->testOption(QColorDialogOptions::ShowAlphaChannel)];
- if (windowModality == Qt::NonModal)
+ if (windowModality != Qt::WindowModal)
[delegate showModelessPanel];
- // no need to show a Qt::ApplicationModal dialog here, since it will be done in _q_platformRunNativeAppModalPanel()
+ // no need to show a Qt::WindowModal dialog here, because it's necessary to call exec() in that case
return true;
}