Add support to disable close button from the tool window in Cocoa.
Fixed regression from Qt4 that close button could't be disabled from the tool window. With this patch buttons are hidden before using button hints like it's on Windows. Change-Id: I00f03ff9528ccae3b1136312404452b9415953b4 Task-number: QTBUG-45971 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>bb10
parent
43e82a3b09
commit
dd02c1eb38
|
|
@ -799,9 +799,22 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
|
|||
if (flags & Qt::FramelessWindowHint)
|
||||
return styleMask;
|
||||
if ((type & Qt::Popup) == Qt::Popup) {
|
||||
if (!windowIsPopupType(type))
|
||||
styleMask = (NSUtilityWindowMask | NSResizableWindowMask | NSClosableWindowMask |
|
||||
NSMiniaturizableWindowMask | NSTitledWindowMask);
|
||||
if (!windowIsPopupType(type)) {
|
||||
styleMask = NSUtilityWindowMask;
|
||||
if (!(flags & Qt::CustomizeWindowHint)) {
|
||||
styleMask |= NSResizableWindowMask | NSClosableWindowMask |
|
||||
NSMiniaturizableWindowMask | NSTitledWindowMask;
|
||||
} else {
|
||||
if (flags & Qt::WindowMaximizeButtonHint)
|
||||
styleMask |= NSResizableWindowMask;
|
||||
if (flags & Qt::WindowTitleHint)
|
||||
styleMask |= NSTitledWindowMask;
|
||||
if (flags & Qt::WindowCloseButtonHint)
|
||||
styleMask |= NSClosableWindowMask;
|
||||
if (flags & Qt::WindowMinimizeButtonHint)
|
||||
styleMask |= NSMiniaturizableWindowMask;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (type == Qt::Window && !(flags & Qt::CustomizeWindowHint)) {
|
||||
styleMask = (NSResizableWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSTitledWindowMask);
|
||||
|
|
|
|||
Loading…
Reference in New Issue