summaryrefslogtreecommitdiffstats
path: root/tests/manual/windowflags/controls.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <[email protected]>2024-11-11 22:55:36 +0100
committerTor Arne Vestbø <[email protected]>2024-11-25 16:41:08 +0100
commit90fe9874d22f0c4b809a3e493766ef852c72cc39 (patch)
tree8f75873ca766f3608ff8d00e94fbd303213c383d /tests/manual/windowflags/controls.cpp
parent7707ab210fa0f1a478639e2bd05669697bb828e8 (diff)
Introduce Qt::ExpandedClientAreaHint
The hint requests that the window's client area is expanded to fill parts of the window that might be (partially) covered by, or conflicting with, other (system) UI elements, such as the window's title bar, resize controls, or a status bar. The safe area margins of the window will reflect any areas that may have conflicting UI elements. If the client area is expanded into the area previously covered by the frame margins, the frame margins are reduced accordingly, as the frame margins represent the non-client-area parts of the window. This new flag replaces, and overlaps in value, with the existing Qt::MaximizeUsingFullscreenGeometryHint, as the latter was added to cover this exact use-case for mobile platforms. Now that we have the use-case on desktop platforms as well we want to use a more generic flag, so the old flag has been deprecated. Semantically, on iOS and Android, without the flags set, the window can be seen as being maximized to take up the entire screen, but with a frameMargin() that reflects the system status bar and resize controls. That's not technically how we implement things right now, but this is an implementation detail that will be changed in a follow-up. On macOS the flag maps to NSWindowStyleMaskFullSizeContentView, and on Windows we have an implementation cooking that uses the DwmExtendFrameIntoClientArea function. Task-number: QTBUG-127634 Change-Id: I9b6863b1550ccc056c16bce235d87b26a7d239b9 Reviewed-by: Assam Boudjelthia <[email protected]> Reviewed-by: Wladimir Leuschner <[email protected]>
Diffstat (limited to 'tests/manual/windowflags/controls.cpp')
-rw-r--r--tests/manual/windowflags/controls.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/manual/windowflags/controls.cpp b/tests/manual/windowflags/controls.cpp
index 9262eb8bc60..dd96eea5069 100644
--- a/tests/manual/windowflags/controls.cpp
+++ b/tests/manual/windowflags/controls.cpp
@@ -32,6 +32,7 @@ HintControl::HintControl(QWidget *parent)
, customizeWindowGroup(new QGroupBox(tr("Customize window title bar controls")))
, transparentForInputCheckBox(new QCheckBox(tr("Transparent for input")))
, noDropShadowCheckBox(new QCheckBox(tr("No drop shadow")))
+ , expandedClientAreaCheckBox(new QCheckBox(tr("Expanded client area")))
{
connect(msWindowsFixedSizeDialogCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged()));
connect(x11BypassWindowManagerCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged()));
@@ -49,6 +50,8 @@ HintControl::HintControl(QWidget *parent)
connect(customizeWindowGroup, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged()));
connect(transparentForInputCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged()));
connect(noDropShadowCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged()));
+ connect(expandedClientAreaCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged()));
+
auto *layout = new QHBoxLayout(this);
layout->setSpacing(0);
layout->setContentsMargins(ControlLayoutMargin, ControlLayoutMargin,
@@ -66,6 +69,7 @@ HintControl::HintControl(QWidget *parent)
basicHintsLayout->addWidget(transparentForInputCheckBox);
basicHintsLayout->addWidget(msWindowsFixedSizeDialogCheckBox);
basicHintsLayout->addWidget(x11BypassWindowManagerCheckBox);
+ basicHintsLayout->addWidget(expandedClientAreaCheckBox);
layout->addLayout(basicHintsLayout);
customizeWindowGroup->setCheckable(true);
@@ -122,6 +126,8 @@ Qt::WindowFlags HintControl::hints() const
flags |= Qt::WindowTransparentForInput;
if (noDropShadowCheckBox->isChecked())
flags |= Qt::NoDropShadowWindowHint;
+ if (expandedClientAreaCheckBox->isChecked())
+ flags |= Qt::ExpandedClientAreaHint;
return flags;
}
@@ -143,6 +149,7 @@ void HintControl::setHints(Qt::WindowFlags flags)
customizeWindowGroup->setChecked(flags & Qt::CustomizeWindowHint);
transparentForInputCheckBox->setChecked(flags & Qt::WindowTransparentForInput);
noDropShadowCheckBox->setChecked(flags & Qt::NoDropShadowWindowHint);
+ expandedClientAreaCheckBox->setChecked(flags & Qt::ExpandedClientAreaHint);
}
void HintControl::slotCheckBoxChanged()