Commit 9c7888d8 authored by Nate Graham's avatar Nate Graham 🔩

Make margins consistent on all sides for all KCMs

There were two remaining sources of extra margins:
1. Hirden horizontal spacing added by the KPageWidget
2. Extra spacing between the KCM and the buttons below

Both are fixed now.
parent 7f5cf465
......@@ -76,6 +76,9 @@ ModuleView::ModuleView( QWidget * parent )
// Create the Page Widget
d->mPageWidget = new KPageWidget(this);
d->mPageWidget->layout()->setContentsMargins(0, 0, 0, 0);
// Zero out only the horizontal spacing (the vertical spacing is fine)
QGridLayout *gridLayout = static_cast<QGridLayout*>(d->mPageWidget->layout());
gridLayout->setHorizontalSpacing(0);
d->mLayout->addWidget(d->mPageWidget);
// Create the dialog
d->mButtons = new QDialogButtonBox( Qt::Horizontal, this );
......@@ -359,7 +362,7 @@ void ModuleView::activeModuleChanged(KPageWidgetItem * current, KPageWidgetItem
if (activeModule->realModule() && activeModule->realModule()->inherits("KCModuleQml")) {
d->mButtons->setContentsMargins(
style()->pixelMetric(QStyle::PM_LayoutLeftMargin),
style()->pixelMetric(QStyle::PM_LayoutTopMargin),
0, // Remove extra space between KCM content and bottom buttons
style()->pixelMetric(QStyle::PM_LayoutRightMargin),
style()->pixelMetric(QStyle::PM_LayoutBottomMargin));
d->mLayout->setContentsMargins(0, 0, 0, 0);
......
......@@ -359,6 +359,7 @@ void SidebarMode::initEvent()
d->mainWidget->installEventFilter(this);
d->mainLayout = new QHBoxLayout(d->mainWidget);
d->mainLayout->setContentsMargins(0, 0, 0, 0);
d->mainLayout->setSpacing(0);
d->moduleView = new ModuleView( d->mainWidget );
connect( d->moduleView, &ModuleView::moduleChanged, this, &SidebarMode::moduleLoaded );
connect(d->moduleView, &ModuleView::moduleSaved, this, &SidebarMode::updateDefaults);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment