macOS: Disable minimize button for Qt::Dialog windows by default

Regression after 4c78ef80ca, where
we moved the window titlebar button logic from QCocoaWindow's
windowStyleMask function to updateTitleBarButtons.

Fixes: QTBUG-114064
Pick-to: 6.5
Change-Id: Idb0870571e88fa2962af36decd9bc7b53c35664d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-06-02 13:42:02 +02:00
parent 8983225d3c
commit 0ab091c92f

View File

@ -553,10 +553,17 @@ void QCocoaWindow::updateTitleBarButtons(Qt::WindowFlags windowFlags)
bool hideButtons = true;
for (const auto &[button, buttonHint] : buttons) {
// Set up Qt defaults based on window type
bool enabled = true;
if (button == NSWindowMiniaturizeButton)
enabled = window()->type() != Qt::Dialog;
// Let users override via CustomizeWindowHint
if (windowFlags & Qt::CustomizeWindowHint)
enabled = windowFlags & buttonHint;
// Then do some final sanitizations
if (button == NSWindowZoomButton && isFixedSize())
enabled = false;