summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.ui
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-12-17 22:27:40 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-02-06 10:00:39 -0800
commit1ed2f1681ad32eb73cf68964788e81bc03786577 (patch)
treea709e455af9352b757fcb88d5e7ae416712fe210 /desktop-widgets/mainwindow.ui
parent122092707c608e930fbade660be2cb3f7a9c1946 (diff)
downloadsubsurface-1ed2f1681ad32eb73cf68964788e81bc03786577.tar.gz
desktop: remove the view-state
There was the "application state", which decided what to show in the "quadrants" and the "view state" which decided which quadrant to show. These interacted in a hard-to-grasp way. The "view state" is used to show the map or dive list in full screen. I simply couldn't get these two orthogonal states to interact properly. Moreover the thing was buggy: If a quadrant was hidden, the user could still show it, by dragging from the side of the window, at least under KDE. To solve these woes, merge the two states into a single application state. If the widget of a quadrant is set to null, don't show it. So the four "view states" are now "application states" where three of the four quadrants are not shown. This also changes the memory management of the widgets: widgets that are not shown are now removed from the QSplitter objects. This makes it possible that the same widget is shown in *different* quadrants. While writing this, I stumbled upon a Qt bug, which is known since 2014: https://forum.qt.io/topic/43176/qsplitter-sizes-return-0 When restoring the quadrant sizes there was a test whether the quadrant size is 0. If that was the case, a default size was set. This seems not to work if the widgets were recently added. Since this test now always fails, make the quadrants non-collapsible and thus guarantee that 0 is never saved as a size. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mainwindow.ui')
-rw-r--r--desktop-widgets/mainwindow.ui14
1 files changed, 0 insertions, 14 deletions
diff --git a/desktop-widgets/mainwindow.ui b/desktop-widgets/mainwindow.ui
index b7d4b0bf8..7916d5aad 100644
--- a/desktop-widgets/mainwindow.ui
+++ b/desktop-widgets/mainwindow.ui
@@ -32,20 +32,6 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <widget class="QSplitter" name="topSplitter">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <widget class="QStackedWidget" name="topLeft"/>
- <widget class="QStackedWidget" name="topRight"/>
- </widget>
- <widget class="QSplitter" name="bottomSplitter">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <widget class="QStackedWidget" name="bottomLeft"/>
- <widget class="QStackedWidget" name="bottomRight"/>
- </widget>
</widget>
</item>
<item>