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.
This commit is contained in:
Roman Gilg 2020-08-17 20:06:36 +02:00 committed by Nicolas Fella
parent 1204da7944
commit f953678e2e

View file

@ -6,6 +6,7 @@
#include <QApplication>
#include <QCommandLineParser>
#include <QStyle>
#include <KCMultiDialog>
#include <KAboutData>
@ -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();