Skip to content

Commit 604cfd0

Browse files
fesdonomistromangg
authored andcommitted
feat: use flat QGroupBoxes and set documentMode on QTabWidgets
Makes it consistent with other KCMs and and Kirigami KCMs. @teams/vdg
1 parent 351bad8 commit 604cfd0

File tree

6 files changed

+32
-3
lines changed

6 files changed

+32
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ include(ECMGenerateQmlTypes)
4747
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
4848
Crash
4949
DBusAddons
50+
WidgetsAddons
5051
)
5152

5253
find_package(KF6Kirigami ${KF6_MIN_VERSION} CONFIG)

kcms/options/actions.ui

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
2020
<layout class="QVBoxLayout" name="verticalLayout">
2121
<item>
2222
<widget class="QGroupBox" name="groupBox_1">
23+
<property name="flat">
24+
<bool>true</bool>
25+
</property>
2326
<property name="title">
2427
<string>Inactive Inner Window Actions</string>
2528
</property>
@@ -187,6 +190,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
187190
</item>
188191
<item>
189192
<widget class="QGroupBox" name="groupBox_2">
193+
<property name="flat">
194+
<bool>true</bool>
195+
</property>
190196
<property name="title">
191197
<string>Inner Window, Titlebar and Frame Actions</string>
192198
</property>

kcms/options/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ KWinOptions::KWinOptions(QObject* parent, const KPluginMetaData& data)
6565
QVBoxLayout* layout = new QVBoxLayout(widget());
6666
layout->setContentsMargins(0, 0, 0, 0);
6767
tab = new QTabWidget(widget());
68+
tab->setDocumentMode(true);
6869
layout->addWidget(tab);
6970

7071
const auto connectKCM = [this](KCModule* mod) {

kcms/options/mouse.ui

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
2323
<property name="title">
2424
<string>Titlebar Actions</string>
2525
</property>
26+
<property name="flat">
27+
<bool>true</bool>
28+
</property>
2629
<layout class="QFormLayout" name="formLayout_1">
2730
<property name="formAlignment">
2831
<set>Qt::AlignHCenter|Qt::AlignTop</set>
@@ -139,6 +142,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
139142
<property name="title">
140143
<string>Titlebar and Frame Actions</string>
141144
</property>
145+
<property name="flat">
146+
<bool>true</bool>
147+
</property>
142148
<property name="alignment">
143149
<set>Qt::AlignCenter</set>
144150
</property>
@@ -220,7 +226,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
220226
<item row="1" column="1">
221227
<widget class="QComboBox" name="kcfg_CommandActiveTitlebar1">
222228
<property name="sizePolicy">
223-
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
229+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
224230
<horstretch>0</horstretch>
225231
<verstretch>0</verstretch>
226232
</sizepolicy>
@@ -325,7 +331,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
325331
<item row="2" column="1">
326332
<widget class="QComboBox" name="kcfg_CommandActiveTitlebar2">
327333
<property name="sizePolicy">
328-
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
334+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
329335
<horstretch>0</horstretch>
330336
<verstretch>0</verstretch>
331337
</sizepolicy>
@@ -430,7 +436,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
430436
<item row="3" column="1">
431437
<widget class="QComboBox" name="kcfg_CommandActiveTitlebar3">
432438
<property name="sizePolicy">
433-
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
439+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
434440
<horstretch>0</horstretch>
435441
<verstretch>0</verstretch>
436442
</sizepolicy>
@@ -555,6 +561,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
555561
<property name="title">
556562
<string>Maximize Button Actions</string>
557563
</property>
564+
<property name="flat">
565+
<bool>true</bool>
566+
</property>
558567
<layout class="QFormLayout" name="formLayout_2">
559568
<property name="formAlignment">
560569
<set>Qt::AlignHCenter|Qt::AlignTop</set>

kcms/tabbox/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ target_link_libraries(kcm_kwintabbox
3333
KF6::NewStuffWidgets
3434
KF6::Package
3535
KF6::Service
36+
KF6::WidgetsAddons
3637
KF6::XmlGui
3738
Qt::Quick
3839
XCB::XCB

kcms/tabbox/main.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
3030
#include <QSpacerItem>
3131
#include <QStandardItemModel>
3232
#include <QStandardPaths>
33+
#include <QStyle>
3334
#include <QTabWidget>
3435
#include <QVBoxLayout>
3536

@@ -47,6 +48,7 @@ KWinTabBoxConfig::KWinTabBoxConfig(QObject* parent, const KPluginMetaData& data)
4748
, m_data(new KWinTabboxData(this))
4849
{
4950
QTabWidget* tabWidget = new QTabWidget(widget());
51+
tabWidget->setDocumentMode(true);
5052
m_primaryTabBoxUi = new KWinTabBoxConfigForm(KWinTabBoxConfigForm::TabboxType::Main,
5153
m_data->tabBoxConfig(),
5254
m_data->shortcutConfig(),
@@ -67,19 +69,28 @@ KWinTabBoxConfig::KWinTabBoxConfig(QObject* parent, const KPluginMetaData& data)
6769
});
6870

6971
QHBoxLayout* buttonBar = new QHBoxLayout();
72+
QStyle* style = widget()->style();
73+
74+
buttonBar->setContentsMargins(style->pixelMetric(QStyle::PM_LayoutLeftMargin),
75+
0,
76+
style->pixelMetric(QStyle::PM_LayoutRightMargin),
77+
style->pixelMetric(QStyle::PM_LayoutBottomMargin));
7078
QSpacerItem* buttonBarSpacer
7179
= new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
7280
buttonBar->addItem(buttonBarSpacer);
7381
buttonBar->addWidget(ghnsButton);
7482

7583
QVBoxLayout* layout = new QVBoxLayout(widget());
84+
layout->setContentsMargins(0, 0, 0, 0);
7685
KTitleWidget* infoLabel = new KTitleWidget(tabWidget);
7786
infoLabel->setText(
7887
i18n("Focus policy settings limit the functionality of navigating through windows."),
7988
KTitleWidget::InfoMessage);
8089
infoLabel->setIcon(KTitleWidget::InfoMessage, KTitleWidget::ImageLeft);
8190
layout->addWidget(infoLabel, 0);
8291
layout->addWidget(tabWidget, 1);
92+
KSeparator* separator = new KSeparator();
93+
layout->addWidget(separator);
8394
layout->addLayout(buttonBar);
8495
widget()->setLayout(layout);
8596

0 commit comments

Comments
 (0)