diff options
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 14 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.h | 1 |
2 files changed, 14 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); diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h index 4a2de1c6b..859cafed1 100644 --- a/desktop-widgets/mainwindow.h +++ b/desktop-widgets/mainwindow.h @@ -207,6 +207,7 @@ private: void beginChangeState(CurrentState s); void saveSplitterSizes(); void toggleCollapsible(bool toggle); + void showFilterIfEnabled(); void updateLastUsedDir(const QString &s); void registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight); void enterState(CurrentState); |