mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 23:31:32 +08:00
Removed superfluous code and simplified some things
This commit is contained in:
parent
3f256f7249
commit
c80174e7e5
@ -211,7 +211,6 @@ void CAutoHideDockContainer::updateSize()
|
||||
{
|
||||
auto dockContainerParent = parentContainer();
|
||||
auto rect = dockContainerParent->contentRect();
|
||||
qDebug() << "Size " << d->Size;
|
||||
|
||||
switch (sideTabBarArea())
|
||||
{
|
||||
@ -248,6 +247,7 @@ void CAutoHideDockContainer::updateSize()
|
||||
//============================================================================
|
||||
CAutoHideDockContainer::~CAutoHideDockContainer()
|
||||
{
|
||||
qDebug() << "~CAutoHideDockContainer()"
|
||||
ADS_PRINT("~CAutoHideDockContainer");
|
||||
|
||||
// Remove event filter in case there are any queued messages
|
||||
@ -323,8 +323,8 @@ void CAutoHideDockContainer::moveContentsToParent()
|
||||
// If we unpin the auto hide tock widget, then we insert it into the same
|
||||
// location like it had as a auto hide widget. This brings the least surprise
|
||||
// to the user and he does not have to search where the widget was inserted.
|
||||
d->DockWidget->setDockArea(nullptr);
|
||||
parentContainer()->addDockWidget(d->getDockWidgetArea(d->SideTabBarArea), d->DockWidget);
|
||||
parentContainer()->removeDockArea(d->DockArea);
|
||||
}
|
||||
|
||||
|
||||
|
@ -501,6 +501,7 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
|
||||
//============================================================================
|
||||
void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
|
||||
{
|
||||
qDebug() << "CDockAreaWidget::removeDockWidget";
|
||||
ADS_PRINT("CDockAreaWidget::removeDockWidget");
|
||||
auto CurrentDockWidget = currentDockWidget();
|
||||
auto NextOpenDockWidget = (DockWidget == CurrentDockWidget) ? nextOpenDockWidget(DockWidget) : nullptr;
|
||||
|
@ -853,6 +853,7 @@ void DockContainerWidgetPrivate::addDockAreasToList(const QList<CDockAreaWidget*
|
||||
//============================================================================
|
||||
void DockContainerWidgetPrivate::appendDockAreas(const QList<CDockAreaWidget*> NewDockAreas)
|
||||
{
|
||||
qDebug() << "DockContainerWidgetPrivate::appendDockAreas";
|
||||
DockAreas.append(NewDockAreas);
|
||||
for (auto DockArea : NewDockAreas)
|
||||
{
|
||||
@ -898,6 +899,8 @@ void DockContainerWidgetPrivate::saveChildNodesState(QXmlStreamWriter& s, QWidge
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
void DockContainerWidgetPrivate::saveAutoHideWidgetsState(QXmlStreamWriter& s)
|
||||
{
|
||||
for (const auto sideTabBar : SideTabBarWidgets.values())
|
||||
@ -1730,7 +1733,15 @@ void CDockContainerWidget::addDockArea(CDockAreaWidget* DockAreaWidget,
|
||||
//============================================================================
|
||||
void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||
{
|
||||
qDebug() << "CDockContainerWidget::removeDockArea " << d->DockAreas.contains(area);
|
||||
ADS_PRINT("CDockContainerWidget::removeDockArea");
|
||||
// If it is an auto hide area, then there is nothing much to do
|
||||
if (area->isAutoHide())
|
||||
{
|
||||
area->setAutoHideDockContainer(nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
area->disconnect(this);
|
||||
d->DockAreas.removeAll(area);
|
||||
CDockSplitter* Splitter = internal::findParent<CDockSplitter*>(area);
|
||||
@ -1746,24 +1757,6 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||
*p = nullptr;
|
||||
}
|
||||
|
||||
if (area->isAutoHide())
|
||||
{
|
||||
// Removing an area from an auto hide container widget implies deleting the whole auto hide widget
|
||||
// So cleanup will be done when the auto hide container widget is deleted
|
||||
// Note: there is no parent splitter
|
||||
CDockWidget* TopLevelWidget = topLevelDockWidget();
|
||||
|
||||
// Updated the title bar visibility of the dock widget if there is only
|
||||
// one single visible dock widget
|
||||
CDockWidget::emitTopLevelEventForWidget(TopLevelWidget, true);
|
||||
dumpLayout();
|
||||
d->emitDockAreasRemoved();
|
||||
area->setAutoHideDockContainer(nullptr);
|
||||
area->updateAutoHideButtonCheckState();
|
||||
area->updateTitleBarButtonToolTip();
|
||||
return;
|
||||
}
|
||||
|
||||
// If splitter has more than 1 widgets, we are finished and can leave
|
||||
if (Splitter->count() > 1)
|
||||
{
|
||||
@ -1953,6 +1946,7 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
||||
void CDockContainerWidget::dropWidget(QWidget* Widget, DockWidgetArea DropArea, CDockAreaWidget* TargetAreaWidget)
|
||||
{
|
||||
CDockWidget* SingleDockWidget = topLevelDockWidget();
|
||||
qDebug() << "CDockContainerWidget::dropWidget";
|
||||
if (TargetAreaWidget)
|
||||
{
|
||||
d->moveToNewSection(Widget, TargetAreaWidget, DropArea);
|
||||
|
Loading…
Reference in New Issue
Block a user