diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-02-06 12:48:40 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-02-06 10:00:39 -0800 |
commit | f1203d365a4a890410038943cdd4aaaaf6ab558c (patch) | |
tree | 005092ba87bcd2c23c5b04e16689e4ee6a0463d0 | |
parent | 0b0e6672d5622238c2fb583dad6b51813b9338b3 (diff) | |
download | subsurface-f1203d365a4a890410038943cdd4aaaaf6ab558c.tar.gz |
desktop: improve splitter defaults
On first startup, use the splitter values suggested by Dirk:
Top/Bottom: 60/40
Info/Profile: 50/50
List/Map: 60/40
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 689c6588c..c0188047e 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -81,10 +81,6 @@ namespace { QProgressDialog *progressDialog = nullptr; bool progressDialogCanceled = false; int progressCounter = 0; - - int round_int (double value) { - return static_cast<int>(lrint(value)); - }; } extern "C" int updateProgress(const char *text) @@ -902,12 +898,6 @@ void MainWindow::restoreSplitterSizes() if (ui.mainSplitter->count() < 2 || topSplitter->count() < 2 || bottomSplitter->count() < 2) return; - const int appH = qApp->desktop()->size().height(); - const int appW = qApp->desktop()->size().width(); - - QList<int> mainSizes = { round_int(appH * 0.7), round_int(appH * 0.3) }; - QList<int> infoProfileSizes = { round_int(appW * 0.3), round_int(appW * 0.7) }; - QList<int> listGlobeSizes = { round_int(appW * 0.7), round_int(appW * 0.3) }; QSettings settings; settings.beginGroup("MainWindow"); @@ -917,9 +907,12 @@ void MainWindow::restoreSplitterSizes() topSplitter->restoreState(settings.value("topSplitter").toByteArray()); bottomSplitter->restoreState(settings.value("bottomSplitter").toByteArray()); } else { - ui.mainSplitter->setSizes(mainSizes); - topSplitter->setSizes(infoProfileSizes); - bottomSplitter->setSizes(listGlobeSizes); + const int appH = qApp->desktop()->size().height(); + const int appW = qApp->desktop()->size().width(); + + ui.mainSplitter->setSizes({ appH * 3 / 5, appH * 2 / 5 }); + topSplitter->setSizes({ appW / 2, appW / 2 }); + bottomSplitter->setSizes({ appW * 3 / 5, appW * 2 / 5 }); } } |