Reworked toggle view

Previous:
- It would just hide the overlay dock widget and leave the side tabs
still visible
- Close button, toggle view action would simply collapse the dock widget
intsead of completely hiding it

Current:
- Now toggle view and collapse functionality are separated.
- Toggle view will now hide the side tab bars completely
- Close button and toggle view action will completely hide it
- Collapse view will simply hide the overlay dock container without
hiding the side tabs
- Handled logic for floating widgets and toggling view
This commit is contained in:
Syarif Fakhri
2022-09-09 12:18:41 +08:00
parent 6ae14fada3
commit 84c6afa428
8 changed files with 105 additions and 27 deletions

View File

@@ -1074,6 +1074,12 @@ bool DockContainerWidgetPrivate::restoreOverlayDockArea(CDockingStateReader& s,
return false;
}
bool Closed = s.attributes().value("Closed").toInt(&Ok);
if (!Ok)
{
return false;
}
s.skipCurrentElement();
CDockWidget* DockWidget = DockManager->findDockWidget(ObjectName.toString());
if (!DockWidget || Testing)
@@ -1085,15 +1091,14 @@ bool DockContainerWidgetPrivate::restoreOverlayDockArea(CDockingStateReader& s,
// We hide the DockArea here to prevent the short display (the flashing)
// of the dock areas during application startup
DockArea->hide();
DockWidget->setToggleViewActionChecked(false);
DockWidget->setClosedState(true);
DockWidget->setProperty(internal::ClosedProperty, true);
DockWidget->setToggleViewActionChecked(!Closed);
DockWidget->setClosedState(Closed);
DockWidget->setProperty(internal::ClosedProperty, Closed);
DockWidget->setProperty(internal::DirtyProperty, false);
_this->sideTabBar(area)->insertSideTab(0, DockWidget->sideTabWidget());
DockWidget->toggleView(false);
DockArea->overlayDockContainer()->addDockWidget(DockWidget);
DockWidget->sideTabWidget()->show();
DockWidget->sideTabWidget()->updateStyle(); // Needed as the side tab widget get it's left/right property from the overlay dock container which was just added
DockWidget->toggleView(Closed);
}
if (Testing)