diff options
author | Tor Arne Vestbø <[email protected]> | 2024-11-12 14:35:17 +0100 |
---|---|---|
committer | Tor Arne Vestbø <[email protected]> | 2024-11-25 19:38:23 +0000 |
commit | a1e6fed44964a3eb14045bf819d232d6cbad9f59 (patch) | |
tree | 96f70b4f14099a9a798367a3218dce31eaab45cf /tests/manual/windowflags/controls.cpp | |
parent | ebb2658242e4c088099de8b3bc04c1e2af579bdc (diff) |
Add Qt::NoTitleBarBackgroundHint window flag
The flag requests that the window's title bar is drawn without a
background color. This flag is useful in combination with the
Qt::ExpandedClientAreaHint flag, to give the perception that the
window's client area seamlessly blends with the titlebar area
and controls.
Task-number: QTBUG-127634
Change-Id: I1194630d737ae03324f79d2babd7ea3d8fca3d5b
Reviewed-by: Assam Boudjelthia <[email protected]>
Diffstat (limited to 'tests/manual/windowflags/controls.cpp')
-rw-r--r-- | tests/manual/windowflags/controls.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/manual/windowflags/controls.cpp b/tests/manual/windowflags/controls.cpp index dd96eea5069..99b9fcb8f09 100644 --- a/tests/manual/windowflags/controls.cpp +++ b/tests/manual/windowflags/controls.cpp @@ -33,6 +33,7 @@ HintControl::HintControl(QWidget *parent) , transparentForInputCheckBox(new QCheckBox(tr("Transparent for input"))) , noDropShadowCheckBox(new QCheckBox(tr("No drop shadow"))) , expandedClientAreaCheckBox(new QCheckBox(tr("Expanded client area"))) + , noTitleBarBackgroundCheckBox(new QCheckBox(tr("No titlebar background"))) { connect(msWindowsFixedSizeDialogCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged())); connect(x11BypassWindowManagerCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged())); @@ -51,6 +52,7 @@ HintControl::HintControl(QWidget *parent) connect(transparentForInputCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged())); connect(noDropShadowCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged())); connect(expandedClientAreaCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged())); + connect(noTitleBarBackgroundCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged())); auto *layout = new QHBoxLayout(this); layout->setSpacing(0); @@ -70,6 +72,7 @@ HintControl::HintControl(QWidget *parent) basicHintsLayout->addWidget(msWindowsFixedSizeDialogCheckBox); basicHintsLayout->addWidget(x11BypassWindowManagerCheckBox); basicHintsLayout->addWidget(expandedClientAreaCheckBox); + basicHintsLayout->addWidget(noTitleBarBackgroundCheckBox); layout->addLayout(basicHintsLayout); customizeWindowGroup->setCheckable(true); @@ -128,6 +131,8 @@ Qt::WindowFlags HintControl::hints() const flags |= Qt::NoDropShadowWindowHint; if (expandedClientAreaCheckBox->isChecked()) flags |= Qt::ExpandedClientAreaHint; + if (noTitleBarBackgroundCheckBox->isChecked()) + flags |= Qt::NoTitleBarBackgroundHint; return flags; } @@ -150,6 +155,7 @@ void HintControl::setHints(Qt::WindowFlags flags) transparentForInputCheckBox->setChecked(flags & Qt::WindowTransparentForInput); noDropShadowCheckBox->setChecked(flags & Qt::NoDropShadowWindowHint); expandedClientAreaCheckBox->setChecked(flags & Qt::ExpandedClientAreaHint); + noTitleBarBackgroundCheckBox->setChecked(flags & Qt::NoTitleBarBackgroundHint); } void HintControl::slotCheckBoxChanged() |