mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-03-16 02:59:51 +08:00
Fixed some auto hide specific bugs
This commit is contained in:
parent
d2c08aca70
commit
159579fb48
@ -265,6 +265,7 @@ void CAutoHideDockContainer::updateSize()
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
CAutoHideDockContainer::~CAutoHideDockContainer()
|
CAutoHideDockContainer::~CAutoHideDockContainer()
|
||||||
{
|
{
|
||||||
|
qDebug() << "~CAutoHideDockContainer()"
|
||||||
ADS_PRINT("~CAutoHideDockContainer");
|
ADS_PRINT("~CAutoHideDockContainer");
|
||||||
|
|
||||||
// Remove event filter in case there are any queued messages
|
// Remove event filter in case there are any queued messages
|
||||||
|
@ -143,6 +143,7 @@ CAutoHideDockContainer* CAutoHideSideBar::insertDockWidget(int Index, CDockWidge
|
|||||||
auto AutoHideContainer = new CAutoHideDockContainer(DockWidget, d->SideTabArea, d->ContainerWidget);
|
auto AutoHideContainer = new CAutoHideDockContainer(DockWidget, d->SideTabArea, d->ContainerWidget);
|
||||||
DockWidget->dockManager()->dockFocusController()->clearDockWidgetFocus(DockWidget);
|
DockWidget->dockManager()->dockFocusController()->clearDockWidgetFocus(DockWidget);
|
||||||
auto Tab = AutoHideContainer->autoHideTab();
|
auto Tab = AutoHideContainer->autoHideTab();
|
||||||
|
DockWidget->setSideTabWidget(Tab);
|
||||||
insertTab(Index, Tab);
|
insertTab(Index, Tab);
|
||||||
return AutoHideContainer;
|
return AutoHideContainer;
|
||||||
}
|
}
|
||||||
|
@ -498,13 +498,14 @@ void CDockAreaTitleBar::onAutoHideButtonClicked()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
qDebug() << "d->DockArea->currentDockWidget()->toggleAutoHide()";
|
||||||
d->DockArea->currentDockWidget()->toggleAutoHide();
|
d->DockArea->currentDockWidget()->toggleAutoHide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
void CDockAreaTitleBar::onAutoHideDockAreaClicked()
|
void CDockAreaTitleBar::onAutoHideDockAreaActionClicked()
|
||||||
{
|
{
|
||||||
d->DockArea->toggleAutoHide();
|
d->DockArea->toggleAutoHide();
|
||||||
}
|
}
|
||||||
@ -675,7 +676,7 @@ void CDockAreaTitleBar::contextMenuEvent(QContextMenuEvent* ev)
|
|||||||
Action->setEnabled(d->DockArea->features().testFlag(CDockWidget::DockWidgetFloatable));
|
Action->setEnabled(d->DockArea->features().testFlag(CDockWidget::DockWidgetFloatable));
|
||||||
if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideFeatureEnabled))
|
if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideFeatureEnabled))
|
||||||
{
|
{
|
||||||
Action = Menu.addAction(IsAutoHide ? tr("Dock") : tr("Auto Hide Group"), this, SLOT(onAutoHideDockAreaClicked()));
|
Action = Menu.addAction(IsAutoHide ? tr("Dock") : tr("Auto Hide Group"), this, SLOT(onAutoHideDockAreaActionClicked()));
|
||||||
Action->setEnabled(d->DockArea->features().testFlag(CDockWidget::DockWidgetPinnable));
|
Action->setEnabled(d->DockArea->features().testFlag(CDockWidget::DockWidgetPinnable));
|
||||||
}
|
}
|
||||||
Menu.addSeparator();
|
Menu.addSeparator();
|
||||||
|
@ -62,7 +62,7 @@ private Q_SLOTS:
|
|||||||
void onTabsMenuActionTriggered(QAction* Action);
|
void onTabsMenuActionTriggered(QAction* Action);
|
||||||
void onCurrentTabChanged(int Index);
|
void onCurrentTabChanged(int Index);
|
||||||
void onAutoHideButtonClicked();
|
void onAutoHideButtonClicked();
|
||||||
void onAutoHideDockAreaClicked();
|
void onAutoHideDockAreaActionClicked();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
@ -514,6 +514,15 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
|
|||||||
void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
|
void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
|
||||||
{
|
{
|
||||||
ADS_PRINT("CDockAreaWidget::removeDockWidget");
|
ADS_PRINT("CDockAreaWidget::removeDockWidget");
|
||||||
|
|
||||||
|
// If this dock area is in a auto hide container, then we can delete
|
||||||
|
// the auto hide container now
|
||||||
|
if (isAutoHide())
|
||||||
|
{
|
||||||
|
autoHideDockContainer()->cleanupAndDelete();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto CurrentDockWidget = currentDockWidget();
|
auto CurrentDockWidget = currentDockWidget();
|
||||||
auto NextOpenDockWidget = (DockWidget == CurrentDockWidget) ? nextOpenDockWidget(DockWidget) : nullptr;
|
auto NextOpenDockWidget = (DockWidget == CurrentDockWidget) ? nextOpenDockWidget(DockWidget) : nullptr;
|
||||||
|
|
||||||
@ -528,7 +537,7 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
|
|||||||
{
|
{
|
||||||
setCurrentDockWidget(NextOpenDockWidget);
|
setCurrentDockWidget(NextOpenDockWidget);
|
||||||
}
|
}
|
||||||
else if (d->ContentsLayout->isEmpty() && DockContainer->dockAreaCount() >= 1 && !isAutoHide()) // Don't remove empty dock areas that are auto hidden, they'll be deleted by the auto hide dock
|
else if (d->ContentsLayout->isEmpty() && DockContainer->dockAreaCount() >= 1) // Don't remove empty dock areas that are auto hidden, they'll be deleted by the auto hide dock
|
||||||
{
|
{
|
||||||
ADS_PRINT("Dock Area empty");
|
ADS_PRINT("Dock Area empty");
|
||||||
DockContainer->removeDockArea(this);
|
DockContainer->removeDockArea(this);
|
||||||
@ -868,7 +877,6 @@ void CDockAreaWidget::updateAutoHideButtonCheckState()
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
void CDockAreaWidget::updateTitleBarButtonVisibility(bool IsTopLevel) const
|
void CDockAreaWidget::updateTitleBarButtonVisibility(bool IsTopLevel) const
|
||||||
{
|
{
|
||||||
qDebug() << "CDockAreaWidget::updateTitleBarButtonVisibility IsTopLevel " << IsTopLevel;
|
|
||||||
d->updateTitleBarButtonVisibility(IsTopLevel);
|
d->updateTitleBarButtonVisibility(IsTopLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -970,9 +978,15 @@ bool CDockAreaWidget::restoreState(CDockingStateReader& s, CDockAreaWidget*& Cre
|
|||||||
}
|
}
|
||||||
|
|
||||||
ADS_PRINT("Dock Widget found - parent " << DockWidget->parent());
|
ADS_PRINT("Dock Widget found - parent " << DockWidget->parent());
|
||||||
|
if (DockWidget->autoHideDockContainer())
|
||||||
|
{
|
||||||
|
DockWidget->autoHideDockContainer()->cleanupAndDelete();
|
||||||
|
}
|
||||||
|
|
||||||
// We hide the DockArea here to prevent the short display (the flashing)
|
// We hide the DockArea here to prevent the short display (the flashing)
|
||||||
// of the dock areas during application startup
|
// of the dock areas during application startup
|
||||||
DockArea->hide();
|
DockArea->hide();
|
||||||
|
qDebug() << "DockArea->addDockWidget " << DockWidget->windowTitle();
|
||||||
DockArea->addDockWidget(DockWidget);
|
DockArea->addDockWidget(DockWidget);
|
||||||
DockWidget->setToggleViewActionChecked(!Closed);
|
DockWidget->setToggleViewActionChecked(!Closed);
|
||||||
DockWidget->setClosedState(Closed);
|
DockWidget->setClosedState(Closed);
|
||||||
|
@ -1440,6 +1440,7 @@ void CDockContainerWidget::deleteAutoHideWidgets()
|
|||||||
d->AutoHideWidgets.clear();
|
d->AutoHideWidgets.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
QList<CAutoHideDockContainer*> CDockContainerWidget::autoHideWidgets() const
|
QList<CAutoHideDockContainer*> CDockContainerWidget::autoHideWidgets() const
|
||||||
{
|
{
|
||||||
|
@ -437,7 +437,6 @@ bool DockManagerPrivate::restoreState(const QByteArray& State, int version)
|
|||||||
// Hide updates of floating widgets from use
|
// Hide updates of floating widgets from use
|
||||||
hideFloatingWidgets();
|
hideFloatingWidgets();
|
||||||
markDockWidgetsDirty();
|
markDockWidgetsDirty();
|
||||||
_this->deleteAutoHideWidgets();
|
|
||||||
|
|
||||||
if (!restoreStateFromXml(state, version))
|
if (!restoreStateFromXml(state, version))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user