summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteve Mokris <smokris@softpixel.com>2016-04-16 16:47:57 -0400
committerSteve Mokris <smokris@softpixel.com>2016-04-27 16:13:18 +0000
commit2a995c77d4f29d34fc252d0cab9ed4b316ee147b (patch)
tree4eb3dc24014459136264c8995cd2af6fe2318fd3 /src
parent6dfc3541e67f7c9297310c898d928caabde4e1f4 (diff)
Keep QColorDialog::ShowAlphaChannel from expanding the dialog on OS X.
Workaround for Apple rdar://25792119: If you invoke -setShowsAlpha: multiple times before showing the color picker, its height grows irrevocably. Instead, only invoke it once, when we show the dialog. Task-number: QTBUG-44620 Change-Id: I8ffc803b4216cdb466a651951f9f987a7b6c1f2e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index 47f9539d9c..488c9b8928 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -132,7 +132,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
- (void)setDialogHelper:(QCocoaColorDialogHelper *)helper
{
mHelper = helper;
- [mColorPanel setShowsAlpha:mHelper->options()->testOption(QColorDialogOptions::ShowAlphaChannel)];
+
if (mHelper->options()->testOption(QColorDialogOptions::NoButtons)) {
[self restoreOriginalContentView];
} else if (!mStolenContentView) {
@@ -483,6 +483,14 @@ bool QCocoaColorDialogHelper::show(Qt::WindowFlags, Qt::WindowModality windowMod
{
if (windowModality == Qt::WindowModal)
windowModality = Qt::ApplicationModal;
+
+ // Workaround for Apple rdar://25792119: If you invoke
+ // -setShowsAlpha: multiple times before showing the color
+ // picker, its height grows irrevocably. Instead, only
+ // invoke it once, when we show the dialog.
+ [[NSColorPanel sharedColorPanel] setShowsAlpha:
+ options()->testOption(QColorDialogOptions::ShowAlphaChannel)];
+
sharedColorPanel()->init(this);
return sharedColorPanel()->show(windowModality, parent);
}