mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 21:25:44 +08:00
Move logic for enabling auto hide into the public toggle method
This commit is contained in:
parent
3e9dc7f4d6
commit
bfab7e495a
@ -457,12 +457,11 @@ void CDockAreaTitleBar::onCurrentTabChanged(int Index)
|
|||||||
updateDockWidgetActionsButtons();
|
updateDockWidgetActionsButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================================
|
||||||
void CDockAreaTitleBar::onAutoHideButtonClicked(bool Checked)
|
void CDockAreaTitleBar::onAutoHideButtonClicked(bool Checked)
|
||||||
{
|
{
|
||||||
if (Checked != d->DockArea->isOverlayed())
|
d->DockArea->toggleAutoHideArea(Checked);
|
||||||
{
|
|
||||||
d->DockArea->toggleAutoHideArea();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1009,11 +1009,16 @@ void CDockAreaWidget::closeArea()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
void CDockAreaWidget::toggleAutoHideArea()
|
void CDockAreaWidget::toggleAutoHideArea(bool Enable)
|
||||||
{
|
{
|
||||||
const auto area = dockContainer()->getDockAreaPosition(this);
|
const auto area = dockContainer()->getDockAreaPosition(this);
|
||||||
for (const auto DockWidget : openedDockWidgets())
|
for (const auto DockWidget : openedDockWidgets())
|
||||||
{
|
{
|
||||||
|
if (Enable == isOverlayed())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
onAutoHideToggleRequested(DockWidget, !isOverlayed(), area);
|
onAutoHideToggleRequested(DockWidget, !isOverlayed(), area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,6 +153,11 @@ protected:
|
|||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void toggleView(bool Open);
|
void toggleView(bool Open);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto hides the dock area and all dock widgets in this area
|
||||||
|
*/
|
||||||
|
void onAutoHideToggleRequested(CDockWidget* DockWidget, bool Enable, SideTabBarArea area);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Super = QFrame;
|
using Super = QFrame;
|
||||||
|
|
||||||
@ -357,12 +362,7 @@ public Q_SLOTS:
|
|||||||
/**
|
/**
|
||||||
* Toggles the Auto hides behaviour of the dock area and all dock widgets in this area
|
* Toggles the Auto hides behaviour of the dock area and all dock widgets in this area
|
||||||
*/
|
*/
|
||||||
void toggleAutoHideArea();
|
void toggleAutoHideArea(bool Enable);
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto hides the dock area and all dock widgets in this area
|
|
||||||
*/
|
|
||||||
void onAutoHideToggleRequested(CDockWidget* DockWidget, bool Enable, SideTabBarArea area);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function closes all other areas except of this area
|
* This function closes all other areas except of this area
|
||||||
|
Loading…
Reference in New Issue
Block a user