Use explicit naming for functions to configure auto hide flags and disable auto hide feature by default

This commit is contained in:
Uwe Kindler 2022-11-01 11:35:07 +01:00
parent fba9c7ce5d
commit 760c0365e0
5 changed files with 15 additions and 10 deletions

View File

@ -654,7 +654,7 @@ CMainWindow::CMainWindow(QWidget *parent) :
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
// uncomment if you would like to enable dock widget auto hiding
CDockManager::setConfigFlags(CDockManager::DefaultAutoHideConfig);
CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig);
// uncomment if you would like to enable an equal distribution of the
// available size of a splitter to all contained dock widgets
@ -749,7 +749,7 @@ void CMainWindow::onViewToggled(bool Open)
return;
}
//qDebug() << DockWidget->objectName() << " viewToggled(" << Open << ")";
qDebug() << DockWidget->objectName() << " viewToggled(" << Open << ")";
}

View File

@ -27,7 +27,7 @@ CMainWindow::CMainWindow(QWidget *parent)
CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true);
CDockManager::setConfigFlag(CDockManager::XmlCompressionEnabled, false);
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
CDockManager::setConfigFlag(CDockManager::DefaultAutoHideConfig, true);
CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig);
DockManager = new CDockManager(this);
// Set central widget

View File

@ -93,7 +93,7 @@ enum eStateFileVersion
};
static CDockManager::ConfigFlags StaticConfigFlags = CDockManager::DefaultNonOpaqueConfig;
static CDockManager::AutoHideFlags StaticAutoHideConfigFlags = CDockManager::DefaultAutoHideConfig;
static CDockManager::AutoHideFlags StaticAutoHideConfigFlags; // auto hide feature is disabled by default
static QString FloatingContainersTitle;
@ -1159,7 +1159,7 @@ void CDockManager::setConfigFlags(const ConfigFlags Flags)
//===========================================================================
void CDockManager::setConfigFlags(const AutoHideFlags Flags)
void CDockManager::setAutoHideConfigFlags(const AutoHideFlags Flags)
{
StaticAutoHideConfigFlags = Flags;
}
@ -1173,7 +1173,7 @@ void CDockManager::setConfigFlag(eConfigFlag Flag, bool On)
//===========================================================================
void CDockManager::setConfigFlag(eAutoHideFlag Flag, bool On)
void CDockManager::setAutoHideConfigFlag(eAutoHideFlag Flag, bool On)
{
internal::setFlag(StaticAutoHideConfigFlags, Flag, On);
}

View File

@ -226,9 +226,15 @@ public:
};
Q_DECLARE_FLAGS(ConfigFlags, eConfigFlag)
/**
* These global configuration flags configure some dock manager auto hide
* settings
* Set the dock manager flags, before you create the dock manager instance.
*/
enum eAutoHideFlag
{
AutoHideFeatureEnabled = 0x01,
AutoHideFeatureEnabled = 0x01, //!< enables / disables auto hide feature
DockAreaHasAutoHideButton = 0x02, //!< If the flag is set each dock area has a auto hide menu button
LeftSideBarIconOnly = 0x04, //!< If the flag is set left side bar will show only icon if a the dock widget has an icon assigned
RightSideBarIconOnly = 0x08, //!< If the flag is set right side bar will show only icon if a the dock widget has an icon assigned
@ -279,7 +285,7 @@ public:
* Call this function before you create the dock manager and before
* your create the first dock widget.
*/
static void setConfigFlags(const AutoHideFlags Flags);
static void setAutoHideConfigFlags(const AutoHideFlags Flags);
/**
* Set a certain config flag.
@ -291,7 +297,7 @@ public:
* Set a certain overlay config flag.
* \see setConfigFlags()
*/
static void setConfigFlag(eAutoHideFlag Flag, bool On = true);
static void setAutoHideConfigFlag(eAutoHideFlag Flag, bool On = true);
/**
* Returns true if the given config flag is set

View File

@ -117,7 +117,6 @@ CSideTabBar::CSideTabBar(CDockContainerWidget* parent, SideBarLocation area) :
CSideTabBar::~CSideTabBar()
{
qDebug() << "~CSideTabBar() ";
qDebug() << "parent " << d->ContainerWidget;
// The SideTabeBar is not the owner of the tabs and to prevent deletion
// we set the parent here to nullptr to remove it from the children
auto Tabs = findChildren<CDockWidgetSideTab*>(QString(), Qt::FindDirectChildrenOnly);