diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-02-09 16:01:50 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-02-11 12:29:07 -0800 |
commit | 2ae33376f7ee303ddaf5ba25fb8315f4302d3e05 (patch) | |
tree | cc35b42044cb7d04a48be51d55b9621bd9f2593f /desktop-widgets/mainwindow.cpp | |
parent | 7b61cd745234719e45a2e45714326793f785a809 (diff) | |
download | subsurface-2ae33376f7ee303ddaf5ba25fb8315f4302d3e05.tar.gz |
Desktop: show filter panel with maximized dive list
This way we can filter both in the default layout and in the dive list layout.
Fixes #1951
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 173b5c3b6..4d3df6ccb 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -1033,7 +1033,7 @@ void MainWindow::on_actionViewList_triggered() toggleCollapsible(true); beginChangeState(LIST_MAXIMIZED); ui.mainSplitter->setSizes({ COLLAPSED, EXPANDED }); - ui.bottomSplitter->setSizes({ EXPANDED, COLLAPSED }); + showFilterIfEnabled(); } void MainWindow::on_actionViewProfile_triggered() @@ -1806,8 +1806,20 @@ void MainWindow::on_paste_triggered() void MainWindow::on_actionFilterTags_triggered() { setApplicationState(getCurrentAppState() == "FilterDive" ? "Default" : "FilterDive"); + if (state == LIST_MAXIMIZED) + showFilterIfEnabled(); } +void MainWindow::showFilterIfEnabled() +{ + if (getCurrentAppState() == "FilterDive") { + const int appW = qApp->desktop()->size().width(); + QList<int> profileFilterSizes = { round_int(appW * 0.7), round_int(appW * 0.3) }; + ui.bottomSplitter->setSizes(profileFilterSizes); + } else { + ui.bottomSplitter->setSizes({ EXPANDED, COLLAPSED }); + } +} void MainWindow::registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight) { applicationState[state] = WidgetForQuadrant(topLeft, topRight, bottomLeft, bottomRight); |