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

@@ -86,7 +86,7 @@ public:
int storedWidth();
// Called from the place holders
void placeHolderChanged(NavigationWidgetPlaceHolder *holder);
void placeHolderChanged();
QHash<Utils::Id, Command *> commandMap() const;
QAbstractItemModel *factoryModel() const;
@@ -96,7 +96,11 @@ protected:
private:
void closeSubWidget(Internal::NavigationSubWidget *subWidget);
void updateToggleText();
bool toggleActionVisible() const;
bool toggleActionEnabled() const;
bool toggleActionChecked() const;
void updateMode();
void updateToggleAction();
Internal::NavigationSubWidget *insertSubItem(int position,
int factoryIndex,
bool updateActivationsMap = true);