diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-02-03 18:46:27 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-02-15 15:23:47 +0000 |
commit | 666b91fb8f5a1b68232d6903b6bfcf84fe13641d (patch) | |
tree | 81a5eafb8e33df1330adc796d2ba38c9d6c4aa01 | |
parent | 1e7143cff8e062758920a4ad31cf164aa2fa94dd (diff) |
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 <timur.pocheptsov@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 3 |
1 files changed, 2 insertions, 1 deletions
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)]; } |