Use sidebar buttons for hiding/showing dock areas

So far, if a mode includes navigation widget placeholders, these are
used for the sidebar toggle buttons, otherwise the buttons are disabled.

Now, if a mode does not include navigation widget placeholders, but the
mode has a FancyMainWindow attached, use the buttons to hide or show the
corresponding dock widget area (left or right).

Since QMainWindow does not really support "hiding a dock widget area",
the FancyMainWindow needs to track that state manually, by tracking the
dock widgets that were visible before "hiding the dock widget area".

Also, if a dock widget is dragged into a "hidden" area, or a widget is
made visible or "unfloated" into that area, show the other widgets in the
area again as well, "unhiding" the area.

Since the mode widgets that have a mainwindow somewhere usually wrap
that into a splitter for the output panes, and the Design mode is
actually a stack widget, IMode needs another method that returns the
appropriate FancyMainWindow if available.

The patch implements this for Widget Designer.

Change-Id: I03531f4d5130c846ff5d65831b1c9be210e1c561
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Eike Ziller
2023-11-24 09:26:31 +01:00
parent 09e94ae4ac
commit a35deb1532
10 changed files with 230 additions and 47 deletions

View File

@@ -5,6 +5,10 @@
#include "modemanager.h"
#include <utils/fancymainwindow.h>
#include <aggregation/aggregate.h>
namespace Core {
/*!
@@ -111,6 +115,11 @@ void IMode::setEnabled(bool enabled)
emit enabledStateChanged(m_isEnabled);
}
Utils::FancyMainWindow *IMode::mainWindow()
{
return Aggregation::query<Utils::FancyMainWindow>(widget());
}
bool IMode::isEnabled() const
{
return m_isEnabled;