diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/mainwindow.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 1d4b22a8e..586be85f0 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -561,8 +561,18 @@ void MainWindow::on_actionYearlyStatistics_triggered() } #define BEHAVIOR QList<int>() + +#define TOGGLE_COLLAPSABLE( X ) \ + ui.mainSplitter->setCollapsible(0, X); \ + ui.mainSplitter->setCollapsible(1, X); \ + ui.infoProfileSplitter->setCollapsible(0, X); \ + ui.infoProfileSplitter->setCollapsible(1, X); \ + ui.listGlobeSplitter->setCollapsible(0, X); \ + ui.listGlobeSplitter->setCollapsible(1, X); + void MainWindow::on_actionViewList_triggered() { + TOGGLE_COLLAPSABLE( true ); beginChangeState(LIST_MAXIMIZED); ui.listGlobeSplitter->setSizes(BEHAVIOR << EXPANDED << COLLAPSED); ui.mainSplitter->setSizes(BEHAVIOR << COLLAPSED << EXPANDED); @@ -570,6 +580,7 @@ void MainWindow::on_actionViewList_triggered() void MainWindow::on_actionViewProfile_triggered() { + TOGGLE_COLLAPSABLE( true ); beginChangeState(PROFILE_MAXIMIZED); ui.infoProfileSplitter->setSizes(BEHAVIOR << COLLAPSED << EXPANDED); ui.mainSplitter->setSizes(BEHAVIOR << EXPANDED << COLLAPSED); @@ -577,6 +588,7 @@ void MainWindow::on_actionViewProfile_triggered() void MainWindow::on_actionViewInfo_triggered() { + TOGGLE_COLLAPSABLE( true ); beginChangeState(INFO_MAXIMIZED); ui.infoProfileSplitter->setSizes(BEHAVIOR << EXPANDED << COLLAPSED); ui.mainSplitter->setSizes(BEHAVIOR << EXPANDED << COLLAPSED); @@ -584,6 +596,7 @@ void MainWindow::on_actionViewInfo_triggered() void MainWindow::on_actionViewGlobe_triggered() { + TOGGLE_COLLAPSABLE( true ); beginChangeState(GLOBE_MAXIMIZED); ui.mainSplitter->setSizes(BEHAVIOR << COLLAPSED << EXPANDED); ui.listGlobeSplitter->setSizes(BEHAVIOR << COLLAPSED << EXPANDED); @@ -592,6 +605,7 @@ void MainWindow::on_actionViewGlobe_triggered() void MainWindow::on_actionViewAll_triggered() { + TOGGLE_COLLAPSABLE( false ); beginChangeState(VIEWALL); static QList<int> mainSizes; const int appH = qApp->desktop()->size().height(); @@ -630,8 +644,16 @@ void MainWindow::on_actionViewAll_triggered() ui.infoProfileSplitter->setSizes(infoProfileSizes); ui.listGlobeSplitter->setSizes(listGlobeSizes); } + ui.mainSplitter->setCollapsible(0, false); + ui.mainSplitter->setCollapsible(1, false); + ui.infoProfileSplitter->setCollapsible(0, false); + ui.infoProfileSplitter->setCollapsible(1, false); + ui.listGlobeSplitter->setCollapsible(0,false); + ui.listGlobeSplitter->setCollapsible(1,false); } +#undef TOGGLE_COLLAPSABLE + void MainWindow::beginChangeState(CurrentState s) { if (state == VIEWALL && state != s) { |