mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Rename overlayDockContainer -> AutoHideDockContainer
This commit is contained in:
parent
ae55013566
commit
8610a64b51
@ -46,8 +46,8 @@ CMainWindow::CMainWindow(QWidget *parent)
|
||||
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
|
||||
TableDockWidget->resize(250, 150);
|
||||
TableDockWidget->setMinimumSize(200,150);
|
||||
TableDockWidget->setDefaultOverlayDockProportion(0.5);
|
||||
DockManager->addOverlayDockWidget(CDockWidgetSideTab::SideTabBarArea::LeftTop, TableDockWidget, CDockWidget::Last);
|
||||
TableDockWidget->setDefaultAutoHideDockProportion(0.5);
|
||||
DockManager->addAutoHideDockWidget(CDockWidgetSideTab::SideTabBarArea::LeftTop, TableDockWidget, CDockWidget::Last);
|
||||
ui->menuView->addAction(TableDockWidget->toggleViewAction());
|
||||
|
||||
table = new QTableWidget();
|
||||
@ -58,7 +58,7 @@ CMainWindow::CMainWindow(QWidget *parent)
|
||||
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
|
||||
TableDockWidget->resize(250, 150);
|
||||
TableDockWidget->setMinimumSize(200,150);
|
||||
DockManager->addOverlayDockWidget(CDockWidgetSideTab::SideTabBarArea::LeftTop, TableDockWidget, CDockWidget::Last);
|
||||
DockManager->addAutoHideDockWidget(CDockWidgetSideTab::SideTabBarArea::LeftTop, TableDockWidget, CDockWidget::Last);
|
||||
ui->menuView->addAction(TableDockWidget->toggleViewAction());
|
||||
|
||||
QTableWidget* propertiesTable = new QTableWidget();
|
||||
|
@ -21,7 +21,7 @@
|
||||
/// \file DockWidgetTab.h
|
||||
/// \author Syarif Fakhri
|
||||
/// \date 05.09.2022
|
||||
/// \brief Implementation of COverlayDockContainer class
|
||||
/// \brief Implementation of CAutoHideDockContainer class
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
@ -110,7 +110,7 @@ struct AutoHideDockContainerPrivate
|
||||
|
||||
return QPoint();
|
||||
}
|
||||
}; // struct OverlayDockContainerPrivate
|
||||
}; // struct AutoHideDockContainerPrivate
|
||||
|
||||
//============================================================================
|
||||
AutoHideDockContainerPrivate::AutoHideDockContainerPrivate(
|
||||
@ -133,12 +133,12 @@ CAutoHideDockContainer::CAutoHideDockContainer(CDockManager* DockManager, CDockW
|
||||
d->DockManager = DockManager;
|
||||
d->Area = area;
|
||||
d->DockArea = new CDockAreaWidget(DockManager, parent);
|
||||
d->DockArea->setObjectName("overlayDockArea");
|
||||
d->DockArea->setOverlayDockContainer(this);
|
||||
d->DockArea->setObjectName("autoHideDockArea");
|
||||
d->DockArea->setAutoHideDockContainer(this);
|
||||
d->DockArea->updateAutoHideButtonCheckState();
|
||||
d->DockArea->updateTitleBarButtonToolTip();
|
||||
|
||||
setObjectName("overlaySplitter");
|
||||
setObjectName("autoHideSplitter");
|
||||
setChildrenCollapsible(false);
|
||||
|
||||
const auto emptyWidget = new QWidget();
|
||||
@ -172,7 +172,7 @@ CAutoHideDockContainer::CAutoHideDockContainer(CDockManager* DockManager, CDockW
|
||||
updateMask();
|
||||
updateSize();
|
||||
|
||||
parent->registerOverlayWidget(this);
|
||||
parent->registerAutoHideWidget(this);
|
||||
|
||||
d->DockArea->installEventFilter(this);
|
||||
parent->installEventFilter(this);
|
||||
@ -214,13 +214,13 @@ CAutoHideDockContainer::CAutoHideDockContainer(CDockWidget* DockWidget, CDockWid
|
||||
CAutoHideDockContainer(DockWidget->dockManager(), area, parent)
|
||||
{
|
||||
addDockWidget(DockWidget);
|
||||
setDockSizeProportion(DockWidget->DefaultOverlayDockProportion());
|
||||
setDockSizeProportion(DockWidget->DefaultAutoHideDockProportion());
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
CAutoHideDockContainer::~CAutoHideDockContainer()
|
||||
{
|
||||
ADS_PRINT("~COverlayDockContainer");
|
||||
ADS_PRINT("~CAutoHideDockContainer");
|
||||
|
||||
// Remove event filter in case there are any queued messages
|
||||
d->DockArea->removeEventFilter(this);
|
||||
@ -228,7 +228,7 @@ CAutoHideDockContainer::~CAutoHideDockContainer()
|
||||
|
||||
if (d->DockManager)
|
||||
{
|
||||
parentContainer()->removeOverlayWidget(this);
|
||||
parentContainer()->removeAutoHideWidget(this);
|
||||
}
|
||||
|
||||
delete d;
|
||||
@ -500,7 +500,7 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
|
||||
|
||||
// Now we check, if the user clicked inside of this auto hide container.
|
||||
// If the click is inside of this auto hide container, then we can also
|
||||
// ignore the event, because the overlay should not get collapsed if
|
||||
// ignore the event, because the auto hide overlay should not get collapsed if
|
||||
// user works in it
|
||||
QMouseEvent* me = static_cast<QMouseEvent*>(event);
|
||||
auto pos = d->DockArea->mapFromGlobal(me->globalPos());
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef OverlayDockContainerH
|
||||
#define OverlayDockContainerH
|
||||
#ifndef AutoHideDockContainerH
|
||||
#define AutoHideDockContainerH
|
||||
/*******************************************************************************
|
||||
** Qt Advanced Docking System
|
||||
** Copyright (C) 2017 Uwe Kindler
|
||||
@ -23,7 +23,7 @@
|
||||
/// \file DockWidgetTab.h
|
||||
/// \author Syarif Fakhri
|
||||
/// \date 05.09.2022
|
||||
/// \brief Declaration of COverlayDockContainer class
|
||||
/// \brief Declaration of CAutoHideDockContainer class
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
@ -67,12 +67,12 @@ protected:
|
||||
|
||||
public:
|
||||
/**
|
||||
* Create overlay widget with a dock manager
|
||||
* Create Auto Hide widget with a dock manager
|
||||
*/
|
||||
CAutoHideDockContainer(CDockManager* DockManager, CDockWidgetSideTab::SideTabBarArea area, CDockContainerWidget* parent);
|
||||
|
||||
/**
|
||||
* Create overlay widget with the given dock widget
|
||||
* Create Auto Hide widget with the given dock widget
|
||||
*/
|
||||
CAutoHideDockContainer(CDockWidget* DockWidget, CDockWidgetSideTab::SideTabBarArea area, CDockContainerWidget* parent);
|
||||
|
||||
@ -105,18 +105,18 @@ public:
|
||||
void setDockSizeProportion(float SplitterProportion = 0.25);
|
||||
|
||||
/**
|
||||
* Returns the side tab bar area of this overlay dock container
|
||||
* Returns the side tab bar area of this Auto Hide dock container
|
||||
*/
|
||||
CDockWidgetSideTab::SideTabBarArea sideTabBarArea() const;
|
||||
|
||||
/**
|
||||
* Returns the dock area widget of this overlay dock container
|
||||
* Returns the dock area widget of this Auto Hide dock container
|
||||
*/
|
||||
CDockAreaWidget* dockAreaWidget() const;
|
||||
|
||||
/**
|
||||
* Moves the contents to the parent container widget
|
||||
* Used before removing this overlay dock container
|
||||
* Used before removing this Auto Hide dock container
|
||||
*/
|
||||
void moveContentsToParent();
|
||||
|
||||
@ -136,13 +136,13 @@ public:
|
||||
bool restoreState(CDockingStateReader& Stream, bool Testing);
|
||||
|
||||
/*
|
||||
* Toggles the overlay dock container widget
|
||||
* Toggles the auto Hide dock container widget
|
||||
* This will also hide the side tab widget
|
||||
*/
|
||||
void toggleView(bool Enable);
|
||||
|
||||
/*
|
||||
* Collapses the overlay dock container widget
|
||||
* Collapses the auto hide dock container widget
|
||||
* Does not hide the side tab widget
|
||||
*/
|
||||
void collapseView(bool Enable);
|
||||
|
@ -72,7 +72,7 @@ struct DockAreaTitleBarPrivate
|
||||
QBoxLayout* Layout;
|
||||
CDockAreaWidget* DockArea;
|
||||
CDockAreaTabBar* TabBar;
|
||||
CElidingLabel* OverlayTitleLabel;
|
||||
CElidingLabel* AutoHideTitleLabel;
|
||||
bool MenuOutdated = true;
|
||||
QMenu* TabsMenu;
|
||||
QList<tTitleBarButton*> DockWidgetActionsButtons;
|
||||
@ -94,9 +94,9 @@ struct DockAreaTitleBarPrivate
|
||||
|
||||
|
||||
/**
|
||||
* Creates the overlay title label, only displayed when the dock area is overlayed
|
||||
* Creates the auto hide title label, only displayed when the dock area is overlayed
|
||||
*/
|
||||
void createOverlayTitleLabel();
|
||||
void createAutoHideTitleLabel();
|
||||
|
||||
/**
|
||||
* Creates the internal TabBar
|
||||
@ -124,7 +124,7 @@ struct DockAreaTitleBarPrivate
|
||||
* Returns true if the given config flag is set
|
||||
* Convenience function to ease config flag testing
|
||||
*/
|
||||
static bool testConfigFlag(CDockManager::eOverlayFlag Flag)
|
||||
static bool testConfigFlag(CDockManager::eAutoHideFlag Flag)
|
||||
{
|
||||
return CDockManager::testConfigFlag(Flag);
|
||||
}
|
||||
@ -217,11 +217,11 @@ void DockAreaTitleBarPrivate::createButtons()
|
||||
|
||||
|
||||
//============================================================================
|
||||
void DockAreaTitleBarPrivate::createOverlayTitleLabel()
|
||||
void DockAreaTitleBarPrivate::createAutoHideTitleLabel()
|
||||
{
|
||||
OverlayTitleLabel = new CElidingLabel("");
|
||||
OverlayTitleLabel->setObjectName("overlayTitleLabel");
|
||||
Layout->addWidget(OverlayTitleLabel);
|
||||
AutoHideTitleLabel = new CElidingLabel("");
|
||||
AutoHideTitleLabel->setObjectName("autoHideTitleLabel");
|
||||
Layout->addWidget(AutoHideTitleLabel);
|
||||
}
|
||||
|
||||
|
||||
@ -282,9 +282,9 @@ IFloatingWidget* DockAreaTitleBarPrivate::makeAreaFloating(const QPoint& Offset,
|
||||
//============================================================================
|
||||
void DockAreaTitleBarPrivate::startFloating(const QPoint& Offset)
|
||||
{
|
||||
if (DockArea->overlayDockContainer() != nullptr)
|
||||
if (DockArea->autoHideDockContainer() != nullptr)
|
||||
{
|
||||
DockArea->overlayDockContainer()->hide();
|
||||
DockArea->autoHideDockContainer()->hide();
|
||||
}
|
||||
FloatingWidget = makeAreaFloating(Offset, DraggingFloatingWidget);
|
||||
}
|
||||
@ -305,8 +305,8 @@ CDockAreaTitleBar::CDockAreaTitleBar(CDockAreaWidget* parent) :
|
||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
|
||||
d->createTabBar();
|
||||
d->createOverlayTitleLabel();
|
||||
d->OverlayTitleLabel->setVisible(false); // Default hidden
|
||||
d->createAutoHideTitleLabel();
|
||||
d->AutoHideTitleLabel->setVisible(false); // Default hidden
|
||||
d->Layout->addWidget(new CSpacerWidget(this));
|
||||
d->createButtons();
|
||||
|
||||
@ -511,9 +511,9 @@ QAbstractButton* CDockAreaTitleBar::button(TitleBarButton which) const
|
||||
|
||||
|
||||
//============================================================================
|
||||
CElidingLabel* CDockAreaTitleBar::overlayTitleLabel() const
|
||||
CElidingLabel* CDockAreaTitleBar::autoHideTitleLabel() const
|
||||
{
|
||||
return d->OverlayTitleLabel;
|
||||
return d->AutoHideTitleLabel;
|
||||
}
|
||||
|
||||
|
||||
@ -588,7 +588,7 @@ void CDockAreaTitleBar::mouseMoveEvent(QMouseEvent* ev)
|
||||
// empty
|
||||
if (d->DockArea->dockContainer()->isFloating()
|
||||
&& d->DockArea->dockContainer()->visibleDockAreaCount() == 1
|
||||
&& !d->DockArea->isOverlayed())
|
||||
&& !d->DockArea->isAutoHide())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -607,7 +607,7 @@ void CDockAreaTitleBar::mouseMoveEvent(QMouseEvent* ev)
|
||||
int DragDistance = (d->DragStartMousePos - ev->pos()).manhattanLength();
|
||||
if (DragDistance >= CDockManager::startDragDistance())
|
||||
{
|
||||
ADS_PRINT("CDockAreaTitlBar::startFloating");
|
||||
ADS_PRINT("CDockAreaTitleBar::startFloating");
|
||||
d->startFloating(d->DragStartMousePos);
|
||||
auto Overlay = d->DockArea->dockManager()->containerOverlay();
|
||||
Overlay->setAllowedAreas(OuterDockAreas);
|
||||
@ -672,7 +672,7 @@ int CDockAreaTitleBar::indexOf(QWidget *widget) const
|
||||
//============================================================================
|
||||
QString CDockAreaTitleBar::closeGroupToolTip() const
|
||||
{
|
||||
if (d->DockArea->isOverlayed())
|
||||
if (d->DockArea->isAutoHide())
|
||||
{
|
||||
return QObject::tr("Close Overlay");
|
||||
|
||||
|
@ -122,9 +122,9 @@ public:
|
||||
QAbstractButton* button(TitleBarButton which) const;
|
||||
|
||||
/**
|
||||
* Returns the overlay title label, used when the dock area is overlayed
|
||||
* Returns the auto hide title label, used when the dock area is expanded and auto hidden
|
||||
*/
|
||||
CElidingLabel* overlayTitleLabel() const;
|
||||
CElidingLabel* autoHideTitleLabel() const;
|
||||
|
||||
/**
|
||||
* Updates the visibility of the dock widget actions in the title bar
|
||||
@ -157,7 +157,7 @@ public:
|
||||
|
||||
/**
|
||||
* Close group tool tip based on the current state
|
||||
* Overlayed widgets can only have one dock widget so it does not make sense for the tooltip to show close group
|
||||
* Auto hide widgets can only have one dock widget so it does not make sense for the tooltip to show close group
|
||||
*/
|
||||
QString closeGroupToolTip() const;
|
||||
|
||||
|
@ -248,7 +248,7 @@ struct DockAreaWidgetPrivate
|
||||
DockAreaLayout* ContentsLayout = nullptr;
|
||||
CDockAreaTitleBar* TitleBar = nullptr;
|
||||
CDockManager* DockManager = nullptr;
|
||||
CAutoHideDockContainer* OverlayDockContainer = nullptr;
|
||||
CAutoHideDockContainer* AutoHideDockContainer = nullptr;
|
||||
bool UpdateTitleBarButtons = false;
|
||||
DockWidgetAreas AllowedAreas = DefaultAllowedAreas;
|
||||
QSize MinSizeHint;
|
||||
@ -388,16 +388,16 @@ void DockAreaWidgetPrivate::updateTitleBarButtonVisibility(bool IsTopLevel)
|
||||
{
|
||||
TitleBar->button(TitleBarButtonClose)->setVisible(!container->isFloating());
|
||||
TitleBar->button(TitleBarButtonAutoHide)->setVisible(!container->isFloating() && allDockWidgetsFocusable());
|
||||
// Undock and tabs should never show when overlayed
|
||||
TitleBar->button(TitleBarButtonUndock)->setVisible(!container->isFloating() && !_this->isOverlayed());
|
||||
TitleBar->button(TitleBarButtonTabsMenu)->setVisible(!_this->isOverlayed());
|
||||
// Undock and tabs should never show when auto hidden
|
||||
TitleBar->button(TitleBarButtonUndock)->setVisible(!container->isFloating() && !_this->isAutoHide());
|
||||
TitleBar->button(TitleBarButtonTabsMenu)->setVisible(!_this->isAutoHide());
|
||||
}
|
||||
else
|
||||
{
|
||||
TitleBar->button(TitleBarButtonClose)->setVisible(true);
|
||||
TitleBar->button(TitleBarButtonAutoHide)->setVisible(allDockWidgetsFocusable());
|
||||
TitleBar->button(TitleBarButtonUndock)->setVisible(!_this->isOverlayed());
|
||||
TitleBar->button(TitleBarButtonTabsMenu)->setVisible(!_this->isOverlayed());
|
||||
TitleBar->button(TitleBarButtonUndock)->setVisible(!_this->isAutoHide());
|
||||
TitleBar->button(TitleBarButtonTabsMenu)->setVisible(!_this->isAutoHide());
|
||||
}
|
||||
}
|
||||
|
||||
@ -457,21 +457,21 @@ CDockContainerWidget* CDockAreaWidget::dockContainer() const
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
CAutoHideDockContainer* CDockAreaWidget::overlayDockContainer() const
|
||||
CAutoHideDockContainer* CDockAreaWidget::autoHideDockContainer() const
|
||||
{
|
||||
return d->OverlayDockContainer;
|
||||
return d->AutoHideDockContainer;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
bool CDockAreaWidget::isOverlayed() const
|
||||
bool CDockAreaWidget::isAutoHide() const
|
||||
{
|
||||
return d->OverlayDockContainer != nullptr;
|
||||
return d->AutoHideDockContainer != nullptr;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void CDockAreaWidget::setOverlayDockContainer(CAutoHideDockContainer* OverlayDockContainer)
|
||||
void CDockAreaWidget::setAutoHideDockContainer(CAutoHideDockContainer* AutoHideDockContainer)
|
||||
{
|
||||
d->OverlayDockContainer = OverlayDockContainer;
|
||||
d->AutoHideDockContainer = AutoHideDockContainer;
|
||||
}
|
||||
|
||||
|
||||
@ -496,7 +496,7 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
|
||||
d->tabBar()->insertTab(index, TabWidget);
|
||||
d->tabBar()->blockSignals(false);
|
||||
TabWidget->setVisible(!DockWidget->isClosed());
|
||||
d->TitleBar->overlayTitleLabel()->setText(DockWidget->windowTitle());
|
||||
d->TitleBar->autoHideTitleLabel()->setText(DockWidget->windowTitle());
|
||||
DockWidget->setProperty(INDEX_PROPERTY, index);
|
||||
d->MinSizeHint.setHeight(qMax(d->MinSizeHint.height(), DockWidget->minimumSizeHint().height()));
|
||||
d->MinSizeHint.setWidth(qMax(d->MinSizeHint.width(), DockWidget->minimumSizeHint().width()));
|
||||
@ -534,7 +534,7 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
|
||||
{
|
||||
setCurrentDockWidget(NextOpenDockWidget);
|
||||
}
|
||||
else if (d->ContentsLayout->isEmpty() && DockContainer->dockAreaCount() >= 1 && !isOverlayed()) // Don't remove empty dock areas that are overlayed, they'll be deleted by the overlay dock
|
||||
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
|
||||
{
|
||||
ADS_PRINT("Dock Area empty");
|
||||
DockContainer->removeDockArea(this);
|
||||
@ -602,9 +602,9 @@ void CDockAreaWidget::hideAreaWithNoVisibleContent()
|
||||
{
|
||||
FloatingWidget->hide();
|
||||
}
|
||||
if (isOverlayed())
|
||||
if (isAutoHide())
|
||||
{
|
||||
overlayDockContainer()->hide();
|
||||
autoHideDockContainer()->hide();
|
||||
}
|
||||
}
|
||||
|
||||
@ -834,10 +834,10 @@ void CDockAreaWidget::updateTitleBarVisibility()
|
||||
bool Hidden = Container->hasTopLevelDockWidget() && (Container->isFloating()
|
||||
|| CDockManager::testConfigFlag(CDockManager::HideSingleCentralWidgetTitleBar));
|
||||
Hidden |= (d->Flags.testFlag(HideSingleWidgetTitleBar) && openDockWidgetsCount() == 1);
|
||||
d->TitleBar->setVisible(isOverlayed() ? true : !Hidden); // Titlebar must always be visible when overlayed so it can be dragged
|
||||
d->TitleBar->setVisible(isAutoHide() ? true : !Hidden); // Titlebar must always be visible when auto hidden so it can be dragged
|
||||
auto tabBar = d->TitleBar->tabBar();
|
||||
tabBar->setVisible(isOverlayed() ? false : !Hidden); // Never show tab bar when overlayed
|
||||
d->TitleBar->overlayTitleLabel()->setVisible(CDockManager::testConfigFlag(CDockManager::DockAreaOverlayHasTitle) && isOverlayed()); // Always show when overlayed, never otherwise
|
||||
tabBar->setVisible(isAutoHide() ? false : !Hidden); // Never show tab bar when auto hidden
|
||||
d->TitleBar->autoHideTitleLabel()->setVisible(CDockManager::testConfigFlag(CDockManager::AutoHideDockAreaHasTitle) && isAutoHide()); // Always show when auto hidden, never otherwise
|
||||
updateTitleBarButtonVisibility(Container->topLevelDockArea() == this);
|
||||
}
|
||||
}
|
||||
@ -858,7 +858,7 @@ void CDockAreaWidget::updateAutoHideButtonCheckState()
|
||||
{
|
||||
auto autoHideButton = titleBarButton(TitleBarButtonAutoHide);
|
||||
autoHideButton->blockSignals(true);
|
||||
autoHideButton->setChecked(isOverlayed());
|
||||
autoHideButton->setChecked(isAutoHide());
|
||||
autoHideButton->blockSignals(false);
|
||||
}
|
||||
|
||||
@ -887,9 +887,9 @@ void CDockAreaWidget::saveState(QXmlStreamWriter& s) const
|
||||
s.writeAttribute("Current", Name);
|
||||
// To keep the saved XML data small, we only save the allowed areas and the
|
||||
// dock area flags if the values are different from the default values
|
||||
if (isOverlayed())
|
||||
if (isAutoHide())
|
||||
{
|
||||
overlayDockContainer()->saveState(s);
|
||||
autoHideDockContainer()->saveState(s);
|
||||
}
|
||||
|
||||
if (d->AllowedAreas != DefaultAllowedAreas)
|
||||
@ -1068,11 +1068,10 @@ void CDockAreaWidget::closeArea()
|
||||
// DeleteOnClose feature or CustomCloseHandling, then we delete the dock widget now;
|
||||
// in the case of CustomCloseHandling, the CDockWidget class will emit its
|
||||
// closeRequested signal and not actually delete unless the signal is handled in a way that deletes it
|
||||
// Note: Auto hide and overlays do not support dock widget delete on close
|
||||
auto OpenDockWidgets = openedDockWidgets();
|
||||
if (OpenDockWidgets.count() == 1 &&
|
||||
(OpenDockWidgets[0]->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) || OpenDockWidgets[0]->features().testFlag(CDockWidget::CustomCloseHandling))
|
||||
&& !isOverlayed())
|
||||
&& !isAutoHide())
|
||||
{
|
||||
OpenDockWidgets[0]->closeDockWidgetInternal();
|
||||
}
|
||||
@ -1085,7 +1084,7 @@ void CDockAreaWidget::closeArea()
|
||||
{
|
||||
DockWidget->closeDockWidgetInternal();
|
||||
}
|
||||
else if (DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) && isOverlayed())
|
||||
else if (DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) && isAutoHide())
|
||||
{
|
||||
DockWidget->closeDockWidgetInternal();
|
||||
}
|
||||
@ -1103,12 +1102,12 @@ void CDockAreaWidget::toggleAutoHideArea(bool Enable)
|
||||
const auto area = dockContainer()->getDockAreaPosition(this);
|
||||
for (const auto DockWidget : openedDockWidgets())
|
||||
{
|
||||
if (Enable == isOverlayed())
|
||||
if (Enable == isAutoHide())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
onAutoHideToggleRequested(DockWidget, !isOverlayed(), area);
|
||||
onAutoHideToggleRequested(DockWidget, !isAutoHide(), area);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1117,11 +1116,11 @@ void CDockAreaWidget::onAutoHideToggleRequested(CDockWidget* DockWidget, bool En
|
||||
{
|
||||
if (Enable)
|
||||
{
|
||||
dockContainer()->createAndInitializeDockWidgetOverlayContainer(area, DockWidget, DockWidget->overlayInsertOrder());
|
||||
dockContainer()->createAndInitializeAutoHideDockWidgetContainer(area, DockWidget, DockWidget->autoHideInsertOrder());
|
||||
}
|
||||
else
|
||||
{
|
||||
overlayDockContainer()->moveContentsToParent();
|
||||
autoHideDockContainer()->moveContentsToParent();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ protected:
|
||||
void markTitleBarMenuOutdated();
|
||||
|
||||
/*
|
||||
* Update the auto hide button checked state based on if it's overlayed or not
|
||||
* Update the auto hide button checked state based on if it's contained in an auto hide container or not
|
||||
*/
|
||||
void updateAutoHideButtonCheckState();
|
||||
|
||||
@ -209,21 +209,21 @@ public:
|
||||
CDockContainerWidget* dockContainer() const;
|
||||
|
||||
/**
|
||||
* Returns the overlay dock container widget this dock area widget belongs to or 0
|
||||
* Returns the auto hide dock container widget this dock area widget belongs to or 0
|
||||
* if there is no
|
||||
*/
|
||||
CAutoHideDockContainer* overlayDockContainer() const;
|
||||
CAutoHideDockContainer* autoHideDockContainer() const;
|
||||
|
||||
/**
|
||||
* Returns true if the dock area exists in an overlay dock container
|
||||
* Returns true if the dock area exists in an auto hide dock container
|
||||
*/
|
||||
bool isOverlayed() const;
|
||||
bool isAutoHide() const;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the current overlay dock container
|
||||
* Sets the current auto hide dock container
|
||||
*/
|
||||
void setOverlayDockContainer(CAutoHideDockContainer* OverlayDockContainer);
|
||||
void setAutoHideDockContainer(CAutoHideDockContainer* AutoHideDockContainer);
|
||||
|
||||
/**
|
||||
* Returns the largest minimumSizeHint() of the dock widgets in this
|
||||
|
@ -138,7 +138,7 @@ public:
|
||||
QPointer<CDockManager> DockManager;
|
||||
unsigned int zOrderIndex = 0;
|
||||
QList<CDockAreaWidget*> DockAreas;
|
||||
QList<CAutoHideDockContainer*> OverlayWidgets;
|
||||
QList<CAutoHideDockContainer*> AutoHideWidgets;
|
||||
QMap<CDockWidgetSideTab::SideTabBarArea, CSideTabBar*> SideTabBarWidgets;
|
||||
QGridLayout* Layout = nullptr;
|
||||
QSplitter* RootSplitter = nullptr;
|
||||
@ -221,9 +221,9 @@ public:
|
||||
void saveChildNodesState(QXmlStreamWriter& Stream, QWidget* Widget);
|
||||
|
||||
/**
|
||||
* Save state of overlay widgets
|
||||
* Save state of auto hide widgets
|
||||
*/
|
||||
void saveOverlayWidgetsState(QXmlStreamWriter& Stream);
|
||||
void saveAutoHideWidgetsState(QXmlStreamWriter& Stream);
|
||||
|
||||
/**
|
||||
* Restore state of child nodes.
|
||||
@ -251,16 +251,16 @@ public:
|
||||
bool Testing);
|
||||
|
||||
/**
|
||||
* Restores the overlay dock area.
|
||||
* Assumes that there are no overlay dock areas, and then restores all the dock areas that
|
||||
* Restores the auto hide dock area.
|
||||
* Assumes that there are no auto hidden dock areas, and then restores all the dock areas that
|
||||
* exist in the XML
|
||||
*/
|
||||
bool restoreOverlayDockArea(CDockingStateReader& s, CDockWidgetSideTab::SideTabBarArea area, bool Testing);
|
||||
bool restoreAutoHideDockArea(CDockingStateReader& s, CDockWidgetSideTab::SideTabBarArea area, bool Testing);
|
||||
|
||||
/**
|
||||
* Restores either a dock area or an overlay dock area depending on the value in the XML
|
||||
* Restores either a dock area or an auto hide dock area depending on the value in the XML
|
||||
*/
|
||||
bool restoreDockOrOverlayDockArea(CDockingStateReader& Stream, QWidget*& CreatedWidget,
|
||||
bool restoreDockOrAutoHideDockArea(CDockingStateReader& Stream, QWidget*& CreatedWidget,
|
||||
bool Testing);
|
||||
|
||||
/**
|
||||
@ -898,7 +898,7 @@ void DockContainerWidgetPrivate::saveChildNodesState(QXmlStreamWriter& s, QWidge
|
||||
}
|
||||
}
|
||||
|
||||
void DockContainerWidgetPrivate::saveOverlayWidgetsState(QXmlStreamWriter& Stream)
|
||||
void DockContainerWidgetPrivate::saveAutoHideWidgetsState(QXmlStreamWriter& Stream)
|
||||
{
|
||||
for (const auto sideTabBar : SideTabBarWidgets.values())
|
||||
{
|
||||
@ -1033,7 +1033,7 @@ bool DockContainerWidgetPrivate::restoreSplitter(CDockingStateReader& s,
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
bool DockContainerWidgetPrivate::restoreOverlayDockArea(CDockingStateReader& s, CDockWidgetSideTab::SideTabBarArea area, bool Testing)
|
||||
bool DockContainerWidgetPrivate::restoreAutoHideDockArea(CDockingStateReader& s, CDockWidgetSideTab::SideTabBarArea area, bool Testing)
|
||||
{
|
||||
bool Ok;
|
||||
#ifdef ADS_DEBUG_PRINT
|
||||
@ -1103,9 +1103,9 @@ bool DockContainerWidgetPrivate::restoreOverlayDockArea(CDockingStateReader& s,
|
||||
DockWidget->setProperty(internal::ClosedProperty, Closed);
|
||||
DockWidget->setProperty(internal::DirtyProperty, false);
|
||||
_this->sideTabBar(area)->insertSideTab(-1, DockWidget->sideTabWidget());
|
||||
DockArea->overlayDockContainer()->addDockWidget(DockWidget);
|
||||
DockArea->autoHideDockContainer()->addDockWidget(DockWidget);
|
||||
DockWidget->sideTabWidget()->updateStyle(); // Needed as the side tab widget get it's left/right property from the overlay dock container which was just added
|
||||
DockArea->overlayDockContainer()->toggleView(!Closed);
|
||||
DockArea->autoHideDockContainer()->toggleView(!Closed);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1113,7 +1113,7 @@ bool DockContainerWidgetPrivate::restoreOverlayDockArea(CDockingStateReader& s,
|
||||
|
||||
|
||||
//============================================================================
|
||||
bool DockContainerWidgetPrivate::restoreDockOrOverlayDockArea(CDockingStateReader& Stream, QWidget*& CreatedWidget,
|
||||
bool DockContainerWidgetPrivate::restoreDockOrAutoHideDockArea(CDockingStateReader& Stream, QWidget*& CreatedWidget,
|
||||
bool Testing)
|
||||
{
|
||||
bool Ok;
|
||||
@ -1126,7 +1126,7 @@ bool DockContainerWidgetPrivate::restoreDockOrOverlayDockArea(CDockingStateReade
|
||||
return false;
|
||||
}
|
||||
|
||||
return restoreOverlayDockArea(Stream, sideTabBarArea, Testing);
|
||||
return restoreAutoHideDockArea(Stream, sideTabBarArea, Testing);
|
||||
}
|
||||
|
||||
// If there's no SideTabBarArea value in the XML, or the value of SideTabBarArea is none, restore the dock area
|
||||
@ -1241,7 +1241,7 @@ bool DockContainerWidgetPrivate::restoreChildNodes(CDockingStateReader& s,
|
||||
}
|
||||
else if (s.name() == QLatin1String("Area"))
|
||||
{
|
||||
Result = restoreDockOrOverlayDockArea(s, CreatedWidget, Testing);
|
||||
Result = restoreDockOrAutoHideDockArea(s, CreatedWidget, Testing);
|
||||
ADS_PRINT("DockAreaWidget");
|
||||
}
|
||||
else
|
||||
@ -1458,10 +1458,10 @@ CDockContainerWidget::~CDockContainerWidget()
|
||||
d->DockManager->removeDockContainer(this);
|
||||
}
|
||||
|
||||
auto OverlayWidgets = d->OverlayWidgets;
|
||||
for (auto OverlayWidget : OverlayWidgets)
|
||||
auto AutoHideWidgets = d->AutoHideWidgets;
|
||||
for (auto AutohideWidget : AutoHideWidgets)
|
||||
{
|
||||
delete OverlayWidget;
|
||||
delete AutohideWidget;
|
||||
}
|
||||
|
||||
delete d;
|
||||
@ -1491,7 +1491,7 @@ CDockAreaWidget* CDockContainerWidget::addDockWidget(DockWidgetArea area, CDockW
|
||||
|
||||
|
||||
//============================================================================
|
||||
CAutoHideDockContainer* CDockContainerWidget::createAndInitializeDockWidgetOverlayContainer(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* DockWidget, CDockWidget::eOverlayInsertOrder insertOrder)
|
||||
CAutoHideDockContainer* CDockContainerWidget::createAndInitializeAutoHideDockWidgetContainer(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* DockWidget, CDockWidget::eAutoHideInsertOrder insertOrder)
|
||||
{
|
||||
if (d->DockManager != DockWidget->dockManager())
|
||||
{
|
||||
@ -1609,19 +1609,19 @@ bool CDockContainerWidget::event(QEvent *e)
|
||||
|
||||
|
||||
//============================================================================
|
||||
void CDockContainerWidget::deleteOverlayWidgets()
|
||||
void CDockContainerWidget::deleteAutoHideWidgets()
|
||||
{
|
||||
for (auto OverlayWidget : d->OverlayWidgets)
|
||||
for (auto AutohideWidget : d->AutoHideWidgets)
|
||||
{
|
||||
OverlayWidget->cleanupAndDelete();
|
||||
AutohideWidget->cleanupAndDelete();
|
||||
}
|
||||
d->OverlayWidgets.clear();
|
||||
d->AutoHideWidgets.clear();
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
QList<CAutoHideDockContainer*> CDockContainerWidget::overlayWidgets() const
|
||||
QList<CAutoHideDockContainer*> CDockContainerWidget::autoHideWidgets() const
|
||||
{
|
||||
return d->OverlayWidgets;
|
||||
return d->AutoHideWidgets;
|
||||
}
|
||||
|
||||
|
||||
@ -1658,10 +1658,10 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||
*p = nullptr;
|
||||
}
|
||||
|
||||
if (area->isOverlayed())
|
||||
if (area->isAutoHide())
|
||||
{
|
||||
// Removing an area from an overlay widget implies deleting the whole overlay widget
|
||||
// So cleanup will be done when the overlay widget is deleted
|
||||
// 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();
|
||||
|
||||
@ -1670,7 +1670,7 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||
CDockWidget::emitTopLevelEventForWidget(TopLevelWidget, true);
|
||||
dumpLayout();
|
||||
d->emitDockAreasRemoved();
|
||||
area->setOverlayDockContainer(nullptr);
|
||||
area->setAutoHideDockContainer(nullptr);
|
||||
area->updateAutoHideButtonCheckState();
|
||||
area->updateTitleBarButtonToolTip();
|
||||
return;
|
||||
@ -1801,10 +1801,10 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
||||
auto ContainerDropArea = d->DockManager->containerOverlay()->dropAreaUnderCursor();
|
||||
bool Dropped = false;
|
||||
|
||||
auto overlayWidgets = FloatingWidget->dockContainer()->overlayWidgets();
|
||||
for (const auto overlayWidget : overlayWidgets)
|
||||
auto autoHideWidgets = FloatingWidget->dockContainer()->autoHideWidgets();
|
||||
for (const auto autohideWidget : autoHideWidgets)
|
||||
{
|
||||
createAndInitializeDockWidgetOverlayContainer(overlayWidget->sideTabBarArea(), overlayWidget->dockWidget(), overlayWidget->dockWidget()->overlayInsertOrder());
|
||||
createAndInitializeAutoHideDockWidgetContainer(autohideWidget->sideTabBarArea(), autohideWidget->dockWidget(), autohideWidget->dockWidget()->autoHideInsertOrder());
|
||||
}
|
||||
|
||||
if (DockArea)
|
||||
@ -1949,7 +1949,7 @@ void CDockContainerWidget::saveState(QXmlStreamWriter& s) const
|
||||
#endif
|
||||
}
|
||||
d->saveChildNodesState(s, d->RootSplitter);
|
||||
d->saveOverlayWidgetsState(s);
|
||||
d->saveAutoHideWidgetsState(s);
|
||||
s.writeEndElement();
|
||||
}
|
||||
|
||||
@ -2156,17 +2156,17 @@ void CDockContainerWidget::updateSplitterHandles(QSplitter* splitter)
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void CDockContainerWidget::registerOverlayWidget(CAutoHideDockContainer* OverlayWidget)
|
||||
void CDockContainerWidget::registerAutoHideWidget(CAutoHideDockContainer* AutohideWidget)
|
||||
{
|
||||
d->OverlayWidgets.append(OverlayWidget);
|
||||
Q_EMIT overlayWidgetCreated(OverlayWidget);
|
||||
ADS_PRINT("d->OverlayWidgets.count() " << d->OverlayWidgets.count());
|
||||
d->AutoHideWidgets.append(AutohideWidget);
|
||||
Q_EMIT autoHideWidgetCreated(AutohideWidget);
|
||||
ADS_PRINT("d->AutoHideWidgets.count() " << d->AutoHideWidgets.count());
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void CDockContainerWidget::removeOverlayWidget(CAutoHideDockContainer* OverlayWidget)
|
||||
void CDockContainerWidget::removeAutoHideWidget(CAutoHideDockContainer* AutohideWidget)
|
||||
{
|
||||
d->OverlayWidgets.removeAll(OverlayWidget);
|
||||
d->AutoHideWidgets.removeAll(AutohideWidget);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
@ -85,10 +85,10 @@ protected:
|
||||
virtual bool event(QEvent *e) override;
|
||||
|
||||
/*
|
||||
* Delete function for resetting the overlay widget list
|
||||
* Delete function for resetting the auto hide widget list
|
||||
* Used during restore
|
||||
*/
|
||||
void deleteOverlayWidgets();
|
||||
void deleteAutoHideWidgets();
|
||||
|
||||
/**
|
||||
* Access function for the internal root splitter
|
||||
@ -96,11 +96,11 @@ protected:
|
||||
QSplitter* rootSplitter() const;
|
||||
|
||||
/**
|
||||
* Creates and initializes a dockwidget overlay container into the given area.
|
||||
* Creates and initializes a dockwidget auto hide container into the given area.
|
||||
* Initializing inserts the tabs into the side tab widget and hides it
|
||||
* Returns nullptr if you try and insert into an area where the configuration is not enabled
|
||||
*/
|
||||
CAutoHideDockContainer* createAndInitializeDockWidgetOverlayContainer(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* DockWidget, CDockWidget::eOverlayInsertOrder insertOrder);
|
||||
CAutoHideDockContainer* createAndInitializeAutoHideDockWidgetContainer(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* DockWidget, CDockWidget::eAutoHideInsertOrder insertOrder);
|
||||
|
||||
/**
|
||||
* Helper function for creation of the root splitter
|
||||
@ -185,15 +185,15 @@ protected:
|
||||
|
||||
/**
|
||||
* Registers the given floating widget in the internal list of
|
||||
* overlay widgets
|
||||
* auto hide widgets
|
||||
*/
|
||||
void registerOverlayWidget(CAutoHideDockContainer* OverlayWidget);
|
||||
void registerAutoHideWidget(CAutoHideDockContainer* AutoHideWidget);
|
||||
|
||||
/**
|
||||
* Remove the given overlay widget from the list of registered overlay
|
||||
* Remove the given auto hide widget from the list of registered auto hide
|
||||
* widgets
|
||||
*/
|
||||
void removeOverlayWidget(CAutoHideDockContainer* OverlayWidget);
|
||||
void removeAutoHideWidget(CAutoHideDockContainer* AutoHideWidget);
|
||||
|
||||
|
||||
public:
|
||||
@ -218,7 +218,7 @@ public:
|
||||
CDockAreaWidget* DockAreaWidget = nullptr);
|
||||
|
||||
/**
|
||||
* Get's the overlay dock side tab bar area based on the dock area widget position
|
||||
* Get's the auto hide dock side tab bar area based on the dock area widget position
|
||||
*/
|
||||
CDockWidgetSideTab::SideTabBarArea getDockAreaPosition(CDockAreaWidget* DockAreaWidget);
|
||||
|
||||
@ -324,9 +324,9 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
* Access function for overlay widgets
|
||||
* Access function for auto hide widgets
|
||||
*/
|
||||
QList<CAutoHideDockContainer*> overlayWidgets() const;
|
||||
QList<CAutoHideDockContainer*> autoHideWidgets() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
/**
|
||||
@ -337,9 +337,9 @@ Q_SIGNALS:
|
||||
void dockAreasAdded();
|
||||
|
||||
/**
|
||||
* This signal is emitted, if a new overlay widget has been created.
|
||||
* This signal is emitted, if a new auto hide widget has been created.
|
||||
*/
|
||||
void overlayWidgetCreated(ads::CAutoHideDockContainer* OverlayWidget);
|
||||
void autoHideWidgetCreated(ads::CAutoHideDockContainer* AutoHideWidget);
|
||||
|
||||
/**
|
||||
* This signal is emitted if one or multiple dock areas has been removed
|
||||
|
@ -93,7 +93,7 @@ enum eStateFileVersion
|
||||
};
|
||||
|
||||
static CDockManager::ConfigFlags StaticConfigFlags = CDockManager::DefaultNonOpaqueConfig;
|
||||
static CDockManager::OverlayFlags StaticOverlayConfigFlags = CDockManager::DefaultAutoHideConfig;
|
||||
static CDockManager::AutoHideFlags StaticAutoHideConfigFlags = CDockManager::DefaultAutoHideConfig;
|
||||
|
||||
/**
|
||||
* Private data class of CDockManager class (pimpl)
|
||||
@ -435,7 +435,7 @@ bool DockManagerPrivate::restoreState(const QByteArray& State, int version)
|
||||
// Hide updates of floating widgets from use
|
||||
hideFloatingWidgets();
|
||||
markDockWidgetsDirty();
|
||||
_this->deleteOverlayWidgets();
|
||||
_this->deleteAutoHideWidgets();
|
||||
|
||||
if (!restoreStateFromXml(state, version))
|
||||
{
|
||||
@ -865,16 +865,16 @@ CDockAreaWidget* CDockManager::addDockWidgetToContainer(DockWidgetArea area,
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
CAutoHideDockContainer* CDockManager::addOverlayDockWidget(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* Dockwidget, CDockWidget::eOverlayInsertOrder insertOrder)
|
||||
CAutoHideDockContainer* CDockManager::addAutoHideDockWidget(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* Dockwidget, CDockWidget::eAutoHideInsertOrder insertOrder)
|
||||
{
|
||||
return addOverlayDockWidgetToContainer(area, Dockwidget, this, insertOrder);
|
||||
return addAutoHideDockWidgetToContainer(area, Dockwidget, this, insertOrder);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
CAutoHideDockContainer* CDockManager::addOverlayDockWidgetToContainer(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* Dockwidget, CDockContainerWidget* DockContainerWidget, CDockWidget::eOverlayInsertOrder insertOrder)
|
||||
CAutoHideDockContainer* CDockManager::addAutoHideDockWidgetToContainer(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* Dockwidget, CDockContainerWidget* DockContainerWidget, CDockWidget::eAutoHideInsertOrder insertOrder)
|
||||
{
|
||||
d->DockWidgetsMap.insert(Dockwidget->objectName(), Dockwidget);
|
||||
auto container = DockContainerWidget->createAndInitializeDockWidgetOverlayContainer(area, Dockwidget, insertOrder);
|
||||
auto container = DockContainerWidget->createAndInitializeAutoHideDockWidgetContainer(area, Dockwidget, insertOrder);
|
||||
container->collapseView(true);
|
||||
|
||||
Q_EMIT dockWidgetAdded(Dockwidget);
|
||||
@ -1138,9 +1138,9 @@ CDockManager::ConfigFlags CDockManager::configFlags()
|
||||
return StaticConfigFlags;
|
||||
}
|
||||
|
||||
CDockManager::OverlayFlags CDockManager::overlayConfigFlags()
|
||||
CDockManager::AutoHideFlags CDockManager::autoHideConfigFlags()
|
||||
{
|
||||
return StaticOverlayConfigFlags;
|
||||
return StaticAutoHideConfigFlags;
|
||||
}
|
||||
|
||||
|
||||
@ -1152,9 +1152,9 @@ void CDockManager::setConfigFlags(const ConfigFlags Flags)
|
||||
|
||||
|
||||
//===========================================================================
|
||||
void CDockManager::setConfigFlags(const OverlayFlags Flags)
|
||||
void CDockManager::setConfigFlags(const AutoHideFlags Flags)
|
||||
{
|
||||
StaticOverlayConfigFlags = Flags;
|
||||
StaticAutoHideConfigFlags = Flags;
|
||||
}
|
||||
|
||||
|
||||
@ -1166,9 +1166,9 @@ void CDockManager::setConfigFlag(eConfigFlag Flag, bool On)
|
||||
|
||||
|
||||
//===========================================================================
|
||||
void CDockManager::setConfigFlag(eOverlayFlag Flag, bool On)
|
||||
void CDockManager::setConfigFlag(eAutoHideFlag Flag, bool On)
|
||||
{
|
||||
internal::setFlag(StaticOverlayConfigFlags, Flag, On);
|
||||
internal::setFlag(StaticAutoHideConfigFlags, Flag, On);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
@ -1179,9 +1179,9 @@ bool CDockManager::testConfigFlag(eConfigFlag Flag)
|
||||
|
||||
|
||||
//===========================================================================
|
||||
bool CDockManager::testConfigFlag(eOverlayFlag Flag)
|
||||
bool CDockManager::testConfigFlag(eAutoHideFlag Flag)
|
||||
{
|
||||
return overlayConfigFlags().testFlag(Flag);
|
||||
return autoHideConfigFlags().testFlag(Flag);
|
||||
}
|
||||
|
||||
|
||||
|
@ -224,7 +224,7 @@ public:
|
||||
};
|
||||
Q_DECLARE_FLAGS(ConfigFlags, eConfigFlag)
|
||||
|
||||
enum eOverlayFlag
|
||||
enum eAutoHideFlag
|
||||
{
|
||||
DockContainerHasLeftSideBar = 0x01, //!< If the flag is set left side bar will prioritize showing icons only over text
|
||||
DockContainerHasRightSideBar = 0x02, //!< If the flag is set right side bar will prioritize showing icons only over text
|
||||
@ -233,15 +233,15 @@ public:
|
||||
LeftSideBarPrioritizeIconOnly = 0x10, //!< If the flag is set each container will have a left side bar
|
||||
RightSideBarPrioritizeIconOnly = 0x20, //!< If the flag is set each container will have a right side bar
|
||||
BottomSideBarPrioritizeIconOnly = 0x40, //!< If the flag is set bottom side bar will prioritize showing icons only over text
|
||||
DockAreaOverlayHasTitle = 0x80, //!< If the flag is set overlay dock area title bar will show the window title
|
||||
AutoHideDockAreaHasTitle = 0x80, //!< If the flag is set overlay dock area title bar will show the window title
|
||||
|
||||
DefaultAutoHideConfig = DockContainerHasLeftSideBar
|
||||
| DockContainerHasRightSideBar
|
||||
| DockContainerHasBottomSideBar
|
||||
| DockAreaHasAutoHideButton
|
||||
| DockAreaOverlayHasTitle, ///< the default configuration for left and right side bars
|
||||
| AutoHideDockAreaHasTitle, ///< the default configuration for left and right side bars
|
||||
};
|
||||
Q_DECLARE_FLAGS(OverlayFlags, eOverlayFlag)
|
||||
Q_DECLARE_FLAGS(AutoHideFlags, eAutoHideFlag)
|
||||
|
||||
|
||||
/**
|
||||
@ -264,9 +264,9 @@ public:
|
||||
static ConfigFlags configFlags();
|
||||
|
||||
/**
|
||||
* This function returns the overlay configuration flags
|
||||
* This function returns the auto hide configuration flags
|
||||
*/
|
||||
static OverlayFlags overlayConfigFlags();
|
||||
static AutoHideFlags autoHideConfigFlags();
|
||||
|
||||
/**
|
||||
* Sets the global configuration flags for the whole docking system.
|
||||
@ -280,7 +280,7 @@ public:
|
||||
* Call this function before you create the dock manager and before
|
||||
* your create the first dock widget.
|
||||
*/
|
||||
static void setConfigFlags(const OverlayFlags Flags);
|
||||
static void setConfigFlags(const AutoHideFlags Flags);
|
||||
|
||||
/**
|
||||
* Set a certain config flag.
|
||||
@ -292,7 +292,7 @@ public:
|
||||
* Set a certain overlay config flag.
|
||||
* \see setConfigFlags()
|
||||
*/
|
||||
static void setConfigFlag(eOverlayFlag Flag, bool On = true);
|
||||
static void setConfigFlag(eAutoHideFlag Flag, bool On = true);
|
||||
|
||||
/**
|
||||
* Returns true if the given config flag is set
|
||||
@ -302,7 +302,7 @@ public:
|
||||
/**
|
||||
* Returns true if the given overlay config flag is set
|
||||
*/
|
||||
static bool testConfigFlag(eOverlayFlag Flag);
|
||||
static bool testConfigFlag(eAutoHideFlag Flag);
|
||||
|
||||
/**
|
||||
* Returns the global icon provider.
|
||||
@ -339,16 +339,16 @@ public:
|
||||
/**
|
||||
* Adds a dock widget overlayed into the dock manager container based on the side tab bar area.
|
||||
* An overlay widget is used for auto hide functionality
|
||||
* \return Returns the COverlayDockContainer that contains the new DockWidget
|
||||
* \return Returns the CAutoHideDockContainer that contains the new DockWidget
|
||||
*/
|
||||
CAutoHideDockContainer* addOverlayDockWidget(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* Dockwidget, CDockWidget::eOverlayInsertOrder insertOrder = CDockWidget::Last);
|
||||
CAutoHideDockContainer* addAutoHideDockWidget(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* Dockwidget, CDockWidget::eAutoHideInsertOrder insertOrder = CDockWidget::Last);
|
||||
|
||||
/**
|
||||
* Adds dock widget overlayed into the given container based on the CDockWidgetSideTab::SideTabBarArea.
|
||||
* An overlay widget is used for auto hide functionality
|
||||
* \return Returns the COverlayDockContainer that contains the new DockWidget
|
||||
* \return Returns the CAutoHideDockContainer that contains the new DockWidget
|
||||
*/
|
||||
CAutoHideDockContainer* addOverlayDockWidgetToContainer(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* Dockwidget, CDockContainerWidget* DockContainerWidget, CDockWidget::eOverlayInsertOrder = CDockWidget::Last);
|
||||
CAutoHideDockContainer* addAutoHideDockWidgetToContainer(CDockWidgetSideTab::SideTabBarArea area, CDockWidget* Dockwidget, CDockContainerWidget* DockContainerWidget, CDockWidget::eAutoHideInsertOrder = CDockWidget::Last);
|
||||
|
||||
/**
|
||||
* This function will add the given Dockwidget to the given dock area as
|
||||
|
@ -95,8 +95,8 @@ struct DockWidgetPrivate
|
||||
QList<QAction*> TitleBarActions;
|
||||
CDockWidget::eMinimumSizeHintMode MinimumSizeHintMode = CDockWidget::MinimumSizeHintFromDockWidget;
|
||||
WidgetFactory* Factory = nullptr;
|
||||
double DefaultOverlayDockProportion = 0.25;
|
||||
CDockWidget::eOverlayInsertOrder OverlayInsertOrder = CDockWidget::Last;
|
||||
double DefaultAutoHideDockProportion = 0.25;
|
||||
CDockWidget::eAutoHideInsertOrder AutoHideInsertOrder = CDockWidget::Last;
|
||||
|
||||
/**
|
||||
* Private data constructor
|
||||
@ -121,10 +121,10 @@ struct DockWidgetPrivate
|
||||
void updateParentDockArea();
|
||||
|
||||
/**
|
||||
* Closes all overlayed dock widgets if there are no more opened dock areas
|
||||
* This prevents the overlayed dock widgets from being pinned to an empty dock area
|
||||
* Closes all auto hide dock widgets if there are no more opened dock areas
|
||||
* This prevents the auto hide dock widgets from being pinned to an empty dock area
|
||||
*/
|
||||
void closeOverlayDockWidgetsIfNeeded();
|
||||
void closeAutoHideDockWidgetsIfNeeded();
|
||||
|
||||
/**
|
||||
* Setup the top tool bar
|
||||
@ -181,7 +181,7 @@ void DockWidgetPrivate::showDockWidget()
|
||||
DockArea->toggleView(true);
|
||||
TabWidget->show();
|
||||
QSplitter* Splitter = internal::findParent<QSplitter*>(DockArea);
|
||||
while (Splitter && !Splitter->isVisible() && !DockArea->isOverlayed())
|
||||
while (Splitter && !Splitter->isVisible() && !DockArea->isAutoHide())
|
||||
{
|
||||
Splitter->show();
|
||||
Splitter = internal::findParent<QSplitter*>(Splitter);
|
||||
@ -195,11 +195,11 @@ void DockWidgetPrivate::showDockWidget()
|
||||
FloatingWidget->show();
|
||||
}
|
||||
|
||||
// If this widget is pinned and there are no opened dock widgets, unpin the overlay widget by moving it's contents to parent container
|
||||
// If this widget is pinned and there are no opened dock widgets, unpin the auto hide widget by moving it's contents to parent container
|
||||
// While restoring state, opened dock widgets are not valid
|
||||
if (Container->openedDockWidgets().count() == 0 && DockArea->isOverlayed() && !DockManager->isRestoringState())
|
||||
if (Container->openedDockWidgets().count() == 0 && DockArea->isAutoHide() && !DockManager->isRestoringState())
|
||||
{
|
||||
DockArea->overlayDockContainer()->moveContentsToParent();
|
||||
DockArea->autoHideDockContainer()->moveContentsToParent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -211,7 +211,7 @@ void DockWidgetPrivate::hideDockWidget()
|
||||
TabWidget->hide();
|
||||
updateParentDockArea();
|
||||
|
||||
closeOverlayDockWidgetsIfNeeded();
|
||||
closeAutoHideDockWidgetsIfNeeded();
|
||||
|
||||
if (Features.testFlag(CDockWidget::DeleteContentOnClose))
|
||||
{
|
||||
@ -246,18 +246,18 @@ void DockWidgetPrivate::updateParentDockArea()
|
||||
}
|
||||
}
|
||||
|
||||
void DockWidgetPrivate::closeOverlayDockWidgetsIfNeeded()
|
||||
void DockWidgetPrivate::closeAutoHideDockWidgetsIfNeeded()
|
||||
{
|
||||
if (_this->dockContainer() && _this->dockContainer()->openedDockWidgets().isEmpty())
|
||||
{
|
||||
for (auto overlayWidget : _this->dockContainer()->overlayWidgets())
|
||||
for (auto autoHideWidget : _this->dockContainer()->autoHideWidgets())
|
||||
{
|
||||
if (overlayWidget->dockWidget() == _this)
|
||||
if (autoHideWidget->dockWidget() == _this)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
overlayWidget->dockWidget()->toggleView(false);
|
||||
autoHideWidget->dockWidget()->toggleView(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -444,7 +444,7 @@ CAutoHideDockContainer* CDockWidget::autoHideDockContainer() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return d->DockArea->overlayDockContainer();
|
||||
return d->DockArea->autoHideDockContainer();
|
||||
}
|
||||
|
||||
|
||||
@ -653,9 +653,9 @@ void CDockWidget::toggleViewInternal(bool Open)
|
||||
d->DockArea->toggleDockWidgetView(this, Open);
|
||||
}
|
||||
|
||||
if (d->DockArea->isOverlayed())
|
||||
if (d->DockArea->isAutoHide())
|
||||
{
|
||||
d->DockArea->overlayDockContainer()->toggleView(Open);
|
||||
d->DockArea->autoHideDockContainer()->toggleView(Open);
|
||||
}
|
||||
|
||||
if (Open && TopLevelDockWidgetBefore)
|
||||
@ -1019,9 +1019,9 @@ bool CDockWidget::closeDockWidgetInternal(bool ForceClose)
|
||||
FloatingWidget->hide();
|
||||
}
|
||||
}
|
||||
if (d->DockArea && d->DockArea->isOverlayed())
|
||||
if (d->DockArea && d->DockArea->isAutoHide())
|
||||
{
|
||||
d->DockArea->overlayDockContainer()->cleanupAndDelete();
|
||||
d->DockArea->autoHideDockContainer()->cleanupAndDelete();
|
||||
}
|
||||
deleteDockWidget();
|
||||
Q_EMIT closed();
|
||||
@ -1079,21 +1079,19 @@ void CDockWidget::showNormal()
|
||||
//============================================================================
|
||||
void CDockWidget::onDockWidgetSideTabClicked()
|
||||
{
|
||||
const auto overlayContainer = autoHideDockContainer();
|
||||
if (!overlayContainer)
|
||||
const auto autoHideContainer = autoHideDockContainer();
|
||||
if (!autoHideContainer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
overlayContainer->raise();
|
||||
//const auto shouldCollapse = overlayContainer->isVisible();
|
||||
//overlayContainer->collapseView(shouldCollapse);
|
||||
overlayContainer->toggleCollapseState();
|
||||
if (overlayContainer->isVisible())
|
||||
autoHideContainer->raise();
|
||||
autoHideContainer->toggleCollapseState();
|
||||
if (autoHideContainer->isVisible())
|
||||
{
|
||||
// d->DockManager->setDockWidgetFocused(this) does not
|
||||
// de focus the old widget, leading to the overlay still being visible
|
||||
// even after clicking outside the overlay.
|
||||
// de focus the old widget, leading to the auto hide still being visible
|
||||
// even after clicking outside the auto hide.
|
||||
setFocus(Qt::ActiveWindowFocusReason);
|
||||
}
|
||||
}
|
||||
@ -1138,28 +1136,28 @@ bool CDockWidget::isCurrentTab() const
|
||||
|
||||
|
||||
//============================================================================
|
||||
void CDockWidget::setDefaultOverlayDockProportion(float Proportion)
|
||||
void CDockWidget::setDefaultAutoHideDockProportion(float Proportion)
|
||||
{
|
||||
d->DefaultOverlayDockProportion = Proportion;
|
||||
d->DefaultAutoHideDockProportion = Proportion;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
float CDockWidget::DefaultOverlayDockProportion() const
|
||||
float CDockWidget::DefaultAutoHideDockProportion() const
|
||||
{
|
||||
return d->DefaultOverlayDockProportion;
|
||||
return d->DefaultAutoHideDockProportion;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
void CDockWidget::setOverlayInsertOrder(eOverlayInsertOrder insertOrder)
|
||||
void CDockWidget::setAutoHideInsertOrder(eAutoHideInsertOrder insertOrder)
|
||||
{
|
||||
d->OverlayInsertOrder = insertOrder;
|
||||
d->AutoHideInsertOrder = insertOrder;
|
||||
}
|
||||
|
||||
CDockWidget::eOverlayInsertOrder CDockWidget::overlayInsertOrder() const
|
||||
CDockWidget::eAutoHideInsertOrder CDockWidget::autoHideInsertOrder() const
|
||||
{
|
||||
return d->OverlayInsertOrder;
|
||||
return d->AutoHideInsertOrder;
|
||||
}
|
||||
|
||||
|
||||
|
@ -159,7 +159,7 @@ public:
|
||||
DockWidgetForceCloseWithArea = 0x040, ///< dock widget will be closed when the dock area hosting it is closed
|
||||
NoTab = 0x080, ///< dock widget tab will never be shown if this flag is set
|
||||
DeleteContentOnClose = 0x100, ///< deletes only the contained widget on close, keeping the dock widget intact and in place. Attempts to rebuild the contents widget on show if there is a widget factory set.
|
||||
DockWidgetPinnable = 0x200, ///< dock widget can be pinned and added to an overlay widget
|
||||
DockWidgetPinnable = 0x200, ///< dock widget can be pinned and added to an auto hide dock container
|
||||
DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable | DockWidgetFocusable | DockWidgetPinnable,
|
||||
AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose | CustomCloseHandling,
|
||||
DockWidgetAlwaysCloseAndDelete = DockWidgetForceCloseWithArea | DockWidgetDeleteOnClose,
|
||||
@ -230,10 +230,10 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* This mode configures the order of pinning and unpinning overlayed widgets
|
||||
* First will add it to the top of the SideTabBar, while last will append it to the end
|
||||
* This mode configures the order of pinning and unpinning auto hide widgets
|
||||
* First will add it to the top of the SideTabBar, while Last will append it to the end
|
||||
*/
|
||||
enum eOverlayInsertOrder
|
||||
enum eAutoHideInsertOrder
|
||||
{
|
||||
First,
|
||||
Last
|
||||
@ -316,7 +316,7 @@ public:
|
||||
CDockWidgetTab* tabWidget() const;
|
||||
|
||||
/**
|
||||
* Returns the overlay dock container of this dock widget
|
||||
* Returns the auto hide dock container of this dock widget
|
||||
* or 0 if there is none
|
||||
*/
|
||||
CAutoHideDockContainer* autoHideDockContainer() const;
|
||||
@ -524,26 +524,26 @@ public:
|
||||
bool isCurrentTab() const;
|
||||
|
||||
/*
|
||||
* Set default dock proportion when overlayed
|
||||
* see *DefaultOverlayDockProportion()
|
||||
* Set default dock proportion when auto hiding
|
||||
* see *DefaultAutoHideDockProportion()
|
||||
*/
|
||||
void setDefaultOverlayDockProportion(float Proportion);
|
||||
void setDefaultAutoHideDockProportion(float Proportion);
|
||||
|
||||
/*
|
||||
* Set default dock proportion when overlayed
|
||||
* Set default dock proportion when auto hiding
|
||||
* 0.25 is a quarter of the size, 0.5 is half the size, 1 is the entire size
|
||||
*/
|
||||
float DefaultOverlayDockProportion() const;
|
||||
float DefaultAutoHideDockProportion() const;
|
||||
|
||||
/*
|
||||
* Set overlay insertion mode
|
||||
* Set auto hide insertion mode
|
||||
*/
|
||||
void setOverlayInsertOrder(eOverlayInsertOrder insertOrder);
|
||||
void setAutoHideInsertOrder(eAutoHideInsertOrder insertOrder);
|
||||
|
||||
/*
|
||||
* Get overlay insertion mode
|
||||
* Get auto hide insertion mode
|
||||
*/
|
||||
eOverlayInsertOrder overlayInsertOrder() const;
|
||||
eAutoHideInsertOrder autoHideInsertOrder() const;
|
||||
|
||||
public: // reimplements QFrame -----------------------------------------------
|
||||
/**
|
||||
@ -612,7 +612,7 @@ public Q_SLOTS:
|
||||
void showNormal();
|
||||
|
||||
/**
|
||||
* Shows the dock overlay container when the side tab is clicked
|
||||
* Toggles the dock auto hide container when the side tab is clicked
|
||||
*/
|
||||
void onDockWidgetSideTabClicked();
|
||||
|
||||
|
@ -211,9 +211,9 @@ void CDockWidgetSideTab::updateStyle()
|
||||
CDockWidgetSideTab::SideTabBarArea CDockWidgetSideTab::sideTabBarArea() const
|
||||
{
|
||||
auto dockAreaWidget = d->DockWidget->dockAreaWidget();
|
||||
if (dockAreaWidget && dockAreaWidget->isOverlayed())
|
||||
if (dockAreaWidget && dockAreaWidget->isAutoHide())
|
||||
{
|
||||
return dockAreaWidget->overlayDockContainer()->sideTabBarArea();
|
||||
return dockAreaWidget->autoHideDockContainer()->sideTabBarArea();
|
||||
}
|
||||
|
||||
return LeftTop;
|
||||
|
@ -124,7 +124,7 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
|
||||
|
||||
// Include the overlay widget we're dragging as a visible widget
|
||||
auto dockAreaWidget = qobject_cast<CDockAreaWidget*>(Content);
|
||||
if (dockAreaWidget && dockAreaWidget->isOverlayed())
|
||||
if (dockAreaWidget && dockAreaWidget->isAutoHide())
|
||||
{
|
||||
VisibleDockAreas++;
|
||||
}
|
||||
@ -328,7 +328,7 @@ void CFloatingDragPreview::finishDragging()
|
||||
{
|
||||
ADS_PRINT("CFloatingDragPreview::finishDragging");
|
||||
|
||||
cleanupOverlayContainerWidget();
|
||||
cleanupAutoHideContainerWidget();
|
||||
|
||||
auto DockDropArea = d->DockManager->dockAreaOverlay()->visibleDropAreaUnderCursor();
|
||||
auto ContainerDropArea = d->DockManager->containerOverlay()->visibleDropAreaUnderCursor();
|
||||
@ -365,7 +365,7 @@ void CFloatingDragPreview::finishDragging()
|
||||
|
||||
|
||||
//============================================================================
|
||||
void CFloatingDragPreview::cleanupOverlayContainerWidget()
|
||||
void CFloatingDragPreview::cleanupAutoHideContainerWidget()
|
||||
{
|
||||
auto DroppedDockWidget = qobject_cast<CDockWidget*>(d->Content);
|
||||
auto DroppedArea = qobject_cast<CDockAreaWidget*>(d->Content);
|
||||
@ -373,9 +373,9 @@ void CFloatingDragPreview::cleanupOverlayContainerWidget()
|
||||
{
|
||||
DroppedDockWidget->autoHideDockContainer()->cleanupAndDelete();
|
||||
}
|
||||
if (DroppedArea && DroppedArea->overlayDockContainer())
|
||||
if (DroppedArea && DroppedArea->autoHideDockContainer())
|
||||
{
|
||||
DroppedArea->overlayDockContainer()->cleanupAndDelete();
|
||||
DroppedArea->autoHideDockContainer()->cleanupAndDelete();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,9 +93,9 @@ public: // implements IFloatingWidget -----------------------------------------
|
||||
virtual void finishDragging() override;
|
||||
|
||||
/**
|
||||
* Cleanup overlay container if the dragged widget has one
|
||||
* Cleanup auto hide container if the dragged widget has one
|
||||
*/
|
||||
void cleanupOverlayContainerWidget();
|
||||
void cleanupAutoHideContainerWidget();
|
||||
|
||||
Q_SIGNALS:
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user