From 666b91fb8f5a1b68232d6903b6bfcf84fe13641d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 3 Feb 2017 18:46:27 +0100 Subject: macOS: Don't hide NSWindowZoomButton when window can go into fullscreen The button in the title bar is used both for going into full screen and maximizing (zooming) the window. We can't hide/disable it unless both Qt::WindowFullscreenButtonHint and Qt::WindowMaximizeButtonHint are off. This means that when Qt::WindowMaximizeButtonHint is off, it's still going to be possible to Option-click the button to maximize the window, but this is less of a concern than hiding the full screen button when Qt::WindowFullscreenButtonHint is set. Change-Id: I70dbe27b3197fe22c1781277f8bf9a818d71d04d Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoawindow.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 2c4c06fdbc..40159a6e01 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -930,7 +930,8 @@ void QCocoaWindow::setWindowZoomButton(Qt::WindowFlags flags) // in line with the platform style guidelines. bool fixedSizeNoZoom = (windowMinimumSize().isValid() && windowMaximumSize().isValid() && windowMinimumSize() == windowMaximumSize()); - bool customizeNoZoom = ((flags & Qt::CustomizeWindowHint) && !(flags & Qt::WindowMaximizeButtonHint)); + bool customizeNoZoom = ((flags & Qt::CustomizeWindowHint) + && !(flags & (Qt::WindowMaximizeButtonHint | Qt::WindowFullscreenButtonHint))); [[m_nsWindow standardWindowButton:NSWindowZoomButton] setEnabled:!(fixedSizeNoZoom || customizeNoZoom)]; } -- cgit v1.2.3