From f953678e2e1ed39512dcdb8861772d076b04195b Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Mon, 17 Aug 2020 20:06:36 +0200 Subject: [PATCH] Define content margins for settings app The settings app is supposed to be used on its own. The buttons are without any margins to the window border though (when borders are deactivated - the default on Breeze). Set the default layout margins to improve the look. --- settings/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/settings/main.cpp b/settings/main.cpp index 98da3a0d6..93c0d0291 100644 --- a/settings/main.cpp +++ b/settings/main.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -35,6 +36,13 @@ int main(int argc, char** argv) KCMultiDialog* dialog = new KCMultiDialog; dialog->addModule(QStringLiteral("kcm_kdeconnect"), {parser.value(QStringLiteral("args"))}); + + auto style = dialog->style(); + dialog->setContentsMargins(style->pixelMetric(QStyle::PM_LayoutLeftMargin), + style->pixelMetric(QStyle::PM_LayoutTopMargin), + style->pixelMetric(QStyle::PM_LayoutRightMargin), + style->pixelMetric(QStyle::PM_LayoutBottomMargin)); + dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->show();