mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-03-16 02:59:51 +08:00
Fix check state of the auto hide button
when dragging the container into a floating window
This commit is contained in:
parent
fde133c25e
commit
052d3cecb9
@ -800,6 +800,15 @@ void CDockAreaWidget::markTitleBarMenuOutdated()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================================
|
||||||
|
void CDockAreaWidget::updateAutoHidebuttonCheckState()
|
||||||
|
{
|
||||||
|
auto autoHideButton = titleBarButton(TitleBarButtonAutoHide);
|
||||||
|
autoHideButton->blockSignals(true);
|
||||||
|
autoHideButton->setChecked(isOverlayed());
|
||||||
|
autoHideButton->blockSignals(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
void CDockAreaWidget::saveState(QXmlStreamWriter& s) const
|
void CDockAreaWidget::saveState(QXmlStreamWriter& s) const
|
||||||
|
@ -150,6 +150,11 @@ protected:
|
|||||||
*/
|
*/
|
||||||
void markTitleBarMenuOutdated();
|
void markTitleBarMenuOutdated();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Update the auto hide button checked state based on if it's overlayed or not
|
||||||
|
*/
|
||||||
|
void updateAutoHidebuttonCheckState();
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void toggleView(bool Open);
|
void toggleView(bool Open);
|
||||||
|
|
||||||
|
@ -1063,9 +1063,7 @@ bool DockContainerWidgetPrivate::restoreOverlayDockArea(CDockingStateReader& s,
|
|||||||
|
|
||||||
dockContainer->hide();
|
dockContainer->hide();
|
||||||
DockArea = dockContainer->dockAreaWidget();
|
DockArea = dockContainer->dockAreaWidget();
|
||||||
const auto titleBar = DockArea->titleBar();
|
DockArea->updateAutoHidebuttonCheckState();
|
||||||
QSignalBlocker blocker(titleBar);
|
|
||||||
titleBar->button(TitleBarButtonAutoHide)->setChecked(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (s.readNextStartElement())
|
while (s.readNextStartElement())
|
||||||
@ -1655,6 +1653,7 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
|||||||
dumpLayout();
|
dumpLayout();
|
||||||
d->emitDockAreasRemoved();
|
d->emitDockAreasRemoved();
|
||||||
area->setOverlayDockContainer(nullptr);
|
area->setOverlayDockContainer(nullptr);
|
||||||
|
area->updateAutoHidebuttonCheckState();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1783,8 +1782,6 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
|||||||
auto ContainerDropArea = d->DockManager->containerOverlay()->dropAreaUnderCursor();
|
auto ContainerDropArea = d->DockManager->containerOverlay()->dropAreaUnderCursor();
|
||||||
bool Dropped = false;
|
bool Dropped = false;
|
||||||
|
|
||||||
// Handle any overlay widgets
|
|
||||||
// todo: cleanup - move into own func?
|
|
||||||
auto overlayWidgets = FloatingWidget->dockContainer()->overlayWidgets();
|
auto overlayWidgets = FloatingWidget->dockContainer()->overlayWidgets();
|
||||||
for (const auto overlayWidget : overlayWidgets)
|
for (const auto overlayWidget : overlayWidgets)
|
||||||
{
|
{
|
||||||
|
@ -82,10 +82,7 @@ COverlayDockContainer::COverlayDockContainer(CDockManager* DockManager, SideTabB
|
|||||||
d->DockArea = new CDockAreaWidget(DockManager, parent);
|
d->DockArea = new CDockAreaWidget(DockManager, parent);
|
||||||
d->DockArea->setObjectName("OverlayDockArea");
|
d->DockArea->setObjectName("OverlayDockArea");
|
||||||
d->DockArea->setOverlayDockContainer(this);
|
d->DockArea->setOverlayDockContainer(this);
|
||||||
auto autoHideButton = d->DockArea->titleBar()->button(TitleBarButtonAutoHide);
|
d->DockArea->updateAutoHidebuttonCheckState();
|
||||||
autoHideButton->blockSignals(true);
|
|
||||||
autoHideButton->setChecked(true);
|
|
||||||
autoHideButton->blockSignals(false);
|
|
||||||
|
|
||||||
QBoxLayout* l = new QBoxLayout(QBoxLayout::LeftToRight);
|
QBoxLayout* l = new QBoxLayout(QBoxLayout::LeftToRight);
|
||||||
d->Splitter = new QSplitter(Qt::Orientation::Horizontal);
|
d->Splitter = new QSplitter(Qt::Orientation::Horizontal);
|
||||||
|
Loading…
Reference in New Issue
Block a user