From 704eeba289c6bd7e361e46eb1624da235f22536a Mon Sep 17 00:00:00 2001 From: Arto Jonsson Date: Thu, 14 May 2009 10:48:22 +0300 Subject: [PATCH] Drop the contents margins from the main window. The default contents margins used together with the dock windows create weird spacing issues around the graphical chessboard. This commits removes the margins around the 'mainLayout' component. The top margin is not removed however, because it would pack chess clocks and the main menu too tightly. --- projects/gui/src/mainwindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/gui/src/mainwindow.cpp b/projects/gui/src/mainwindow.cpp index 784891e..28191f5 100644 --- a/projects/gui/src/mainwindow.cpp +++ b/projects/gui/src/mainwindow.cpp @@ -54,6 +54,11 @@ MainWindow::MainWindow() mainLayout->addLayout(clockLayout); mainLayout->addWidget(m_chessboardView); + // The content margins look stupid when used with dock widgets. Drop the + // margins except from the top so that the chess clocks have spacing + mainLayout->setContentsMargins(0, + style()->pixelMetric(QStyle::PM_LayoutTopMargin), 0, 0); + QWidget* mainWidget = new QWidget(this); mainWidget->setLayout(mainLayout); setCentralWidget(mainWidget); -- 2.11.4.GIT