mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-14 00:52:05 +08:00
Remove config flag
This commit is contained in:
parent
1c69685257
commit
118e79e7ec
@ -453,34 +453,6 @@ void CAutoHideDockContainer::toggleCollapseState()
|
|||||||
collapseView(isVisible());
|
collapseView(isVisible());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
|
||||||
bool CAutoHideDockContainer::areaExistsInConfig(CDockWidgetSideTab::SideTabBarArea area)
|
|
||||||
{
|
|
||||||
switch (area)
|
|
||||||
{
|
|
||||||
case CDockWidgetSideTab::Left:
|
|
||||||
{
|
|
||||||
return CDockManager::testConfigFlag(CDockManager::DockContainerHasLeftSideBar);
|
|
||||||
}
|
|
||||||
case CDockWidgetSideTab::Right:
|
|
||||||
{
|
|
||||||
return CDockManager::testConfigFlag(CDockManager::DockContainerHasRightSideBar);
|
|
||||||
}
|
|
||||||
case CDockWidgetSideTab::Bottom:
|
|
||||||
{
|
|
||||||
return CDockManager::testConfigFlag(CDockManager::DockContainerHasBottomSideBar);
|
|
||||||
}
|
|
||||||
case CDockWidgetSideTab::Top:
|
|
||||||
{
|
|
||||||
return CDockManager::testConfigFlag(CDockManager::DockContainerHasTopSideBar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
|
bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event)
|
||||||
{
|
{
|
||||||
|
@ -152,11 +152,6 @@ public:
|
|||||||
* Toggles the current collapse state
|
* Toggles the current collapse state
|
||||||
*/
|
*/
|
||||||
void toggleCollapseState();
|
void toggleCollapseState();
|
||||||
|
|
||||||
/*
|
|
||||||
* Convenience function fr determining if area exists in config
|
|
||||||
*/
|
|
||||||
static bool areaExistsInConfig(CDockWidgetSideTab::SideTabBarArea area);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,8 +191,7 @@ void DockAreaTitleBarPrivate::createButtons()
|
|||||||
_this->connect(UndockButton, SIGNAL(clicked()), SLOT(onUndockButtonClicked()));
|
_this->connect(UndockButton, SIGNAL(clicked()), SLOT(onUndockButtonClicked()));
|
||||||
|
|
||||||
// AutoHide Button
|
// AutoHide Button
|
||||||
const auto autoHideEnabled = testConfigFlag(CDockManager::DockContainerHasRightSideBar) || testConfigFlag(CDockManager::DockContainerHasLeftSideBar) || testConfigFlag(CDockManager::DockContainerHasBottomSideBar);
|
AutoHideButton = new CTitleBarButton(testConfigFlag(CDockManager::DockAreaHasAutoHideButton));
|
||||||
AutoHideButton = new CTitleBarButton(testConfigFlag(CDockManager::DockAreaHasAutoHideButton) && autoHideEnabled);
|
|
||||||
AutoHideButton->setObjectName("dockAreaAutoHideButton");
|
AutoHideButton->setObjectName("dockAreaAutoHideButton");
|
||||||
AutoHideButton->setAutoRaise(true);
|
AutoHideButton->setAutoRaise(true);
|
||||||
internal::setToolTip(AutoHideButton, QObject::tr("Toggle Auto Hide"));
|
internal::setToolTip(AutoHideButton, QObject::tr("Toggle Auto Hide"));
|
||||||
|
@ -1048,11 +1048,6 @@ bool DockContainerWidgetPrivate::restoreAutoHideDockArea(CDockingStateReader& s,
|
|||||||
ADS_PRINT("Restore NodeDockArea Tabs: " << Tabs << " Current: "
|
ADS_PRINT("Restore NodeDockArea Tabs: " << Tabs << " Current: "
|
||||||
<< CurrentDockWidget);
|
<< CurrentDockWidget);
|
||||||
|
|
||||||
if (!CAutoHideDockContainer::areaExistsInConfig(area))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
CDockAreaWidget* DockArea = nullptr;
|
CDockAreaWidget* DockArea = nullptr;
|
||||||
CAutoHideDockContainer* dockContainer = nullptr;
|
CAutoHideDockContainer* dockContainer = nullptr;
|
||||||
if (!Testing)
|
if (!Testing)
|
||||||
@ -1503,12 +1498,6 @@ CAutoHideDockContainer* CDockContainerWidget::createAndInitializeAutoHideDockWid
|
|||||||
{
|
{
|
||||||
DockWidget->setDockManager(d->DockManager); // Overlay Dock Container needs a valid dock manager
|
DockWidget->setDockManager(d->DockManager); // Overlay Dock Container needs a valid dock manager
|
||||||
}
|
}
|
||||||
if (!CAutoHideDockContainer::areaExistsInConfig(area))
|
|
||||||
{
|
|
||||||
Q_ASSERT_X(false, "CDockContainerWidget::createAndInitializeDockWidgetOverlayContainer",
|
|
||||||
"Requested area does not exist in config");
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
DockWidget->sideTabWidget()->updateOrientationAndSpacing(area);
|
DockWidget->sideTabWidget()->updateOrientationAndSpacing(area);
|
||||||
sideTabBar(area)->insertSideTab(insertOrder == CDockWidget::First ? 0 : -1, DockWidget->sideTabWidget());
|
sideTabBar(area)->insertSideTab(insertOrder == CDockWidget::First ? 0 : -1, DockWidget->sideTabWidget());
|
||||||
@ -2094,35 +2083,17 @@ void CDockContainerWidget::createRootSplitter()
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
void CDockContainerWidget::createSideTabBarWidgets()
|
void CDockContainerWidget::createSideTabBarWidgets()
|
||||||
{
|
{
|
||||||
if (CDockManager::testConfigFlag(CDockManager::DockContainerHasLeftSideBar))
|
|
||||||
{
|
|
||||||
auto leftLayout = new QVBoxLayout();
|
|
||||||
d->SideTabBarWidgets[CDockWidgetSideTab::Left] = new CSideTabBar(this, Qt::Vertical);
|
d->SideTabBarWidgets[CDockWidgetSideTab::Left] = new CSideTabBar(this, Qt::Vertical);
|
||||||
leftLayout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Left]);
|
d->Layout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Left], 1, 0);
|
||||||
leftLayout->addStretch(1);
|
|
||||||
d->Layout->addLayout(leftLayout, 1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CDockManager::testConfigFlag(CDockManager::DockContainerHasRightSideBar))
|
|
||||||
{
|
|
||||||
auto rightLayout = new QVBoxLayout();
|
|
||||||
d->SideTabBarWidgets[CDockWidgetSideTab::Right] = new CSideTabBar(this, Qt::Vertical);
|
d->SideTabBarWidgets[CDockWidgetSideTab::Right] = new CSideTabBar(this, Qt::Vertical);
|
||||||
rightLayout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Right]);
|
d->Layout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Right],1,2);
|
||||||
rightLayout->addStretch(1);
|
|
||||||
d->Layout->addLayout(rightLayout, 1, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CDockManager::testConfigFlag(CDockManager::DockContainerHasBottomSideBar))
|
|
||||||
{
|
|
||||||
d->SideTabBarWidgets[CDockWidgetSideTab::Bottom] = new CSideTabBar(this, Qt::Horizontal);
|
d->SideTabBarWidgets[CDockWidgetSideTab::Bottom] = new CSideTabBar(this, Qt::Horizontal);
|
||||||
d->Layout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Bottom], 2, 1);
|
d->Layout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Bottom], 2, 1);
|
||||||
}
|
|
||||||
|
|
||||||
if (CDockManager::testConfigFlag(CDockManager::DockContainerHasTopSideBar))
|
|
||||||
{
|
|
||||||
d->SideTabBarWidgets[CDockWidgetSideTab::Top] = new CSideTabBar(this, Qt::Horizontal);
|
d->SideTabBarWidgets[CDockWidgetSideTab::Top] = new CSideTabBar(this, Qt::Horizontal);
|
||||||
d->Layout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Top], 0, 1);
|
d->Layout->addWidget(d->SideTabBarWidgets[CDockWidgetSideTab::Top], 0, 1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -226,23 +226,15 @@ public:
|
|||||||
|
|
||||||
enum eAutoHideFlag
|
enum eAutoHideFlag
|
||||||
{
|
{
|
||||||
DockContainerHasLeftSideBar = 0x01, //!< If the flag is set the dock manager will have a left side bar
|
DockAreaHasAutoHideButton = 0x01, //!< If the flag is set each dock area has a auto hide menu button
|
||||||
DockContainerHasRightSideBar = 0x02, //!< If the flag is set the dock manager will have a right side bar
|
LeftSideBarPrioritizeIconOnly = 0x02, //!< If the flag is set left side bar will prioritize showing icons only over text
|
||||||
DockContainerHasBottomSideBar = 0x04, //!< If the flag is set the dock manager will have a bottom side bar
|
RightSideBarPrioritizeIconOnly = 0x04, //!< If the flag is set right side bar will prioritize showing icons only over text
|
||||||
DockContainerHasTopSideBar = 0x08, //!< If the flag is set the dock manager will have a top side bar
|
BottomSideBarPrioritizeIconOnly = 0x08,//!< If the flag is set bottom side bar will prioritize showing icons only over text
|
||||||
DockAreaHasAutoHideButton = 0x10, //!< If the flag is set each dock area has a auto hide menu button
|
TopSideBarPrioritizeIconOnly = 0x10, //!< If the flag is set top side bar will prioritize showing icons only over text
|
||||||
LeftSideBarPrioritizeIconOnly = 0x20, //!< If the flag is set left side bar will prioritize showing icons only over text
|
AutoHideDockAreaHasTitle = 0x20, //!< If the flag is set overlay dock area title bar will show the window title
|
||||||
RightSideBarPrioritizeIconOnly = 0x40, //!< If the flag is set right side bar will prioritize showing icons only over text
|
AutoHideButtonTogglesArea = 0x40, //!< If the flag is set, the auto hide button enables auto hiding for all dock widgets in an area, if disabled, only the current dock widget will be toggled
|
||||||
BottomSideBarPrioritizeIconOnly = 0x80,//!< If the flag is set bottom side bar will prioritize showing icons only over text
|
|
||||||
TopSideBarPrioritizeIconOnly = 0x100, //!< If the flag is set top side bar will prioritize showing icons only over text
|
|
||||||
AutoHideDockAreaHasTitle = 0x200, //!< If the flag is set overlay dock area title bar will show the window title
|
|
||||||
AutoHideButtonTogglesArea = 0x400, //!< If the flag is set, the auto hide button enables auto hiding for all dock widgets in an area, if disabled, only the current dock widget will be toggled
|
|
||||||
|
|
||||||
DefaultAutoHideConfig = DockContainerHasLeftSideBar
|
DefaultAutoHideConfig = DockAreaHasAutoHideButton
|
||||||
| DockContainerHasRightSideBar
|
|
||||||
| DockContainerHasBottomSideBar
|
|
||||||
| DockContainerHasTopSideBar
|
|
||||||
| DockAreaHasAutoHideButton
|
|
||||||
| AutoHideDockAreaHasTitle, ///< the default configuration for left and right side bars
|
| AutoHideDockAreaHasTitle, ///< the default configuration for left and right side bars
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(AutoHideFlags, eAutoHideFlag)
|
Q_DECLARE_FLAGS(AutoHideFlags, eAutoHideFlag)
|
||||||
|
Loading…
Reference in New Issue
Block a user