From d50e2d3356357fcd81ebb0c170decbf7f5ee932a Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 31 Oct 2014 14:00:52 -0200 Subject: Do not allow to collapse the pannels of the mainwindow Disable the possibility to collapse the pannel in the mainwindow when seeing everything. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'qt-ui/mainwindow.cpp') 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() + +#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 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) { -- cgit v1.2.3-70-g09d2