mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
7482e0540d
commit
8a312616b0
1 changed files with 12 additions and 13 deletions
|
@ -141,13 +141,14 @@ MainWindow::MainWindow() : QMainWindow(),
|
||||||
// and now for some layout hackery
|
// and now for some layout hackery
|
||||||
// this gets us consistent margins everywhere and a much more balanced look
|
// this gets us consistent margins everywhere and a much more balanced look
|
||||||
margins = QMargins(5, 5, 5, 5);
|
margins = QMargins(5, 5, 5, 5);
|
||||||
QList<QString> dontChange;
|
QMargins zeroMargin(0, 0, 0, 0);
|
||||||
dontChange << "notesAndSocialNetworksLayout" <<
|
QList<QString> noMarginList;
|
||||||
"mainTabOuterLayout" <<
|
noMarginList << "notesAndSocialNetworksLayout" <<
|
||||||
"ratingVisibilityWidgets" <<
|
"mainTabOuterLayout" <<
|
||||||
"temperatureLabels" <<
|
"ratingVisibilityWidgets" <<
|
||||||
"airWaterTempLayout" <<
|
"temperatureLabels" <<
|
||||||
"profileInnerLayout";
|
"airWaterTempLayout" <<
|
||||||
|
"profileOuterLayout";
|
||||||
Q_FOREACH (QLayout *layout, findChildren<QLayout *>()) {
|
Q_FOREACH (QLayout *layout, findChildren<QLayout *>()) {
|
||||||
// lots of internally used layouts by Qt have no names
|
// lots of internally used layouts by Qt have no names
|
||||||
// don't mess with those (or scroll bars look terrible, among other things
|
// don't mess with those (or scroll bars look terrible, among other things
|
||||||
|
@ -155,15 +156,13 @@ MainWindow::MainWindow() : QMainWindow(),
|
||||||
continue;
|
continue;
|
||||||
// this allows us to exclude specific layouts where the one size fits all
|
// this allows us to exclude specific layouts where the one size fits all
|
||||||
// doesn't fit
|
// doesn't fit
|
||||||
if (dontChange.contains(layout->objectName()))
|
if (noMarginList.contains(layout->objectName()))
|
||||||
continue;
|
layout->setContentsMargins(zeroMargin);
|
||||||
layout->setContentsMargins(margins);
|
else
|
||||||
|
layout->setContentsMargins(margins);
|
||||||
}
|
}
|
||||||
margins = QMargins(0, 5, 5, 5);
|
margins = QMargins(0, 5, 5, 5);
|
||||||
ui.profileInnerLayout->setContentsMargins(margins);
|
ui.profileInnerLayout->setContentsMargins(margins);
|
||||||
margins = QMargins(0, 0, 0, 0);
|
|
||||||
ui.profileOuterLayout->setContentsMargins(margins);
|
|
||||||
|
|
||||||
updateManager = new UpdateManager(this);
|
updateManager = new UpdateManager(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue