Remove support for min button in QWasmWindow

Minimizing windows is not supported on Wasm. The button has also never
been drawn, so remove the code that supports its hit test.

Change-Id: Ic1c26f1036aa9c7d65c8c61b7fd47ecce32889ca
Pick-to: 6.4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Mikolaj Boc 2022-08-12 13:49:24 +02:00
parent e020a8eaf7
commit cf2dc8d6f3
2 changed files with 5 additions and 11 deletions

View File

@ -223,8 +223,6 @@ void QWasmWindow::injectMousePressed(const QPoint &local, const QPoint &global,
const auto options = makeTitleBarOptions();
if (getTitleBarControlRect(options, SC_TitleBarMaxButton).contains(pointInFrameCoords))
m_activeControl = SC_TitleBarMaxButton;
else if (getTitleBarControlRect(options, SC_TitleBarMinButton).contains(pointInFrameCoords))
m_activeControl = SC_TitleBarMinButton;
else if (getTitleBarControlRect(options, SC_TitleBarCloseButton).contains(pointInFrameCoords))
m_activeControl = SC_TitleBarCloseButton;
else if (getTitleBarControlRect(options, SC_TitleBarNormalButton).contains(pointInFrameCoords))
@ -359,9 +357,7 @@ QRect QWasmWindow::getTitleBarControlRect(const TitleBarOptions &tb, TitleBarCon
}
break;
case SC_TitleBarNormalButton:
if (isMinimized && (tb.flags & Qt::WindowMinimizeButtonHint)) {
offset += delta;
} else if (isMaximized && (tb.flags & Qt::WindowMaximizeButtonHint)) {
if (isMaximized && (tb.flags & Qt::WindowMaximizeButtonHint)) {
ret.adjust(0, 0, -delta * 2, 0);
offset += (delta + delta);
}
@ -395,7 +391,6 @@ QRegion QWasmWindow::titleControlRegion() const
QRegion result;
const auto options = makeTitleBarOptions();
result += getTitleBarControlRect(options, SC_TitleBarCloseButton);
result += getTitleBarControlRect(options, SC_TitleBarMinButton);
result += getTitleBarControlRect(options, SC_TitleBarMaxButton);
result += getTitleBarControlRect(options, SC_TitleBarSysMenu);

View File

@ -19,11 +19,10 @@ public:
enum TitleBarControl {
SC_None = 0x00000000,
SC_TitleBarSysMenu = 0x00000001,
SC_TitleBarMinButton = 0x00000002,
SC_TitleBarMaxButton = 0x00000004,
SC_TitleBarCloseButton = 0x00000008,
SC_TitleBarNormalButton = 0x00000010,
SC_TitleBarLabel = 0x00000100
SC_TitleBarMaxButton = 0x00000002,
SC_TitleBarCloseButton = 0x00000004,
SC_TitleBarNormalButton = 0x00000008,
SC_TitleBarLabel = 0x00000010
};
Q_DECLARE_FLAGS(TitleBarControls, TitleBarControl);