diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-01-02 22:23:56 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-02 22:24:51 -0800 |
commit | 8a312616b04d0216dfe04254717f815bc29a900f (patch) | |
tree | 267773a1d21a39f83ad3d611e01ffb16ca44c8a0 /qt-ui/mainwindow.cpp | |
parent | 7482e0540d583d7f2175cec42da3437a0f49751e (diff) | |
download | subsurface-8a312616b04d0216dfe04254717f815bc29a900f.tar.gz |
Zero out the margins instead of just not changing them
At least on the Mac some objects appear to have generous default margins.
This creates a somewhat less wasteful layout. Still we have those massive
margins around the toolbar buttons.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 3409b5c7f..b4d4fe49d 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -141,13 +141,14 @@ MainWindow::MainWindow() : QMainWindow(), // and now for some layout hackery // this gets us consistent margins everywhere and a much more balanced look margins = QMargins(5, 5, 5, 5); - QList<QString> dontChange; - dontChange << "notesAndSocialNetworksLayout" << - "mainTabOuterLayout" << - "ratingVisibilityWidgets" << - "temperatureLabels" << - "airWaterTempLayout" << - "profileInnerLayout"; + QMargins zeroMargin(0, 0, 0, 0); + QList<QString> noMarginList; + noMarginList << "notesAndSocialNetworksLayout" << + "mainTabOuterLayout" << + "ratingVisibilityWidgets" << + "temperatureLabels" << + "airWaterTempLayout" << + "profileOuterLayout"; Q_FOREACH (QLayout *layout, findChildren<QLayout *>()) { // lots of internally used layouts by Qt have no names // don't mess with those (or scroll bars look terrible, among other things @@ -155,15 +156,13 @@ MainWindow::MainWindow() : QMainWindow(), continue; // this allows us to exclude specific layouts where the one size fits all // doesn't fit - if (dontChange.contains(layout->objectName())) - continue; - layout->setContentsMargins(margins); + if (noMarginList.contains(layout->objectName())) + layout->setContentsMargins(zeroMargin); + else + layout->setContentsMargins(margins); } margins = QMargins(0, 5, 5, 5); ui.profileInnerLayout->setContentsMargins(margins); - margins = QMargins(0, 0, 0, 0); - ui.profileOuterLayout->setContentsMargins(margins); - updateManager = new UpdateManager(this); } |