summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2023-02-02 08:58:19 +0100
committerMikolaj Boc <mikolaj.boc@qt.io>2023-02-04 21:38:33 +0100
commitae51eeb0bb46e6fa21747a4a6f1e33b9a88c39bd (patch)
treec638adf1ca69ca7226c5f3e60692ee94b5eb1894 /src/plugins
parent9ea00c70fbbe61d4c2da98c3d9390bfbada157bd (diff)
Support Qt::WindowMaximizeButtonHint in QWasmWindowHEADdev
Change-Id: I1089ab4706c4342fa5976b1aff18d67d47769687 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.cpp9
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp
index a25be3490c..06d9108866 100644
--- a/src/plugins/platforms/wasm/qwasmwindow.cpp
+++ b/src/plugins/platforms/wasm/qwasmwindow.cpp
@@ -362,6 +362,8 @@ void QWasmWindow::setWindowFlags(Qt::WindowFlags flags)
dom::syncCSSClassWith(m_qtWindow, "has-shadow", !flags.testFlag(Qt::NoDropShadowWindowHint));
dom::syncCSSClassWith(m_qtWindow, "transparent-for-input",
flags.testFlag(Qt::WindowTransparentForInput));
+
+ m_nonClientArea->titleBar()->setMaximizeVisible(hasMaximizeButton());
}
void QWasmWindow::setWindowState(Qt::WindowStates newState)
@@ -422,7 +424,7 @@ void QWasmWindow::applyWindowState()
dom::syncCSSClassWith(m_qtWindow, "maximized", isMaximized);
m_nonClientArea->titleBar()->setRestoreVisible(isMaximized);
- m_nonClientArea->titleBar()->setMaximizeVisible(!isMaximized);
+ m_nonClientArea->titleBar()->setMaximizeVisible(hasMaximizeButton());
if (isVisible())
QWindowSystemInterface::handleWindowStateChanged(window(), m_state, m_previousWindowState);
@@ -521,6 +523,11 @@ bool QWasmWindow::hasTitleBar() const
&& !windowIsPopupType(m_flags);
}
+bool QWasmWindow::hasMaximizeButton() const
+{
+ return !m_state.testFlag(Qt::WindowMaximized) && m_flags.testFlag(Qt::WindowMaximizeButtonHint);
+}
+
bool QWasmWindow::windowIsPopupType(Qt::WindowFlags flags) const
{
if (flags.testFlag(Qt::Tool))
diff --git a/src/plugins/platforms/wasm/qwasmwindow.h b/src/plugins/platforms/wasm/qwasmwindow.h
index 7f4047b758..6c1c4a5adb 100644
--- a/src/plugins/platforms/wasm/qwasmwindow.h
+++ b/src/plugins/platforms/wasm/qwasmwindow.h
@@ -92,6 +92,7 @@ private:
void invalidate();
bool hasTitleBar() const;
+ bool hasMaximizeButton() const;
void applyWindowState();
bool processPointer(const PointerEvent &event);