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