Cocoa: Make dialogs non-resizable again

Fix regression from commit 8b3a120a where also dialogs
got NSResizableWindowMask, making them have a Zoom
button.

Task-number: QTBUG-65668
Change-Id: I21054b3aa6fc11eab3d93f78ede44ae771522e2c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Morten Johan Sørvig 2018-01-18 22:49:42 +01:00
parent 91732818e5
commit f0b8d90402

View File

@ -503,9 +503,10 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
{ {
const Qt::WindowType type = static_cast<Qt::WindowType>(int(flags & Qt::WindowType_Mask)); const Qt::WindowType type = static_cast<Qt::WindowType>(int(flags & Qt::WindowType_Mask));
const bool frameless = (flags & Qt::FramelessWindowHint) || windowIsPopupType(type); const bool frameless = (flags & Qt::FramelessWindowHint) || windowIsPopupType(type);
const bool resizeable = type != Qt::Dialog; // Dialogs: remove zoom button by disabling resize
// Select base window type. // Select base window type. Note that the value of NSBorderlessWindowMask is 0.
NSUInteger styleMask = frameless ? NSBorderlessWindowMask : NSResizableWindowMask; NSUInteger styleMask = (frameless || !resizeable) ? NSBorderlessWindowMask : NSResizableWindowMask;
if (frameless) { if (frameless) {
// No further customizations for frameless since there are no window decorations. // No further customizations for frameless since there are no window decorations.