summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-10-31 14:00:52 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-31 13:52:51 -0700
commitd50e2d3356357fcd81ebb0c170decbf7f5ee932a (patch)
tree1fb616998089aa9db619e4c3386ca2a5182233a8 /qt-ui/mainwindow.cpp
parent9160c26b1a1880a51320137cdb8a02745eba9217 (diff)
downloadsubsurface-d50e2d3356357fcd81ebb0c170decbf7f5ee932a.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp22
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) {