mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Added support for setting config parameters to CDockManager
This commit is contained in:
parent
a13ed7e4d6
commit
eb9b439d11
@ -48,6 +48,7 @@
|
||||
#include <QApplication>
|
||||
#include <QWindow>
|
||||
#include <QWindowStateChangeEvent>
|
||||
#include <QVector>
|
||||
|
||||
#include "FloatingDockContainer.h"
|
||||
#include "DockOverlay.h"
|
||||
@ -94,6 +95,7 @@ enum eStateFileVersion
|
||||
|
||||
static CDockManager::ConfigFlags StaticConfigFlags = CDockManager::DefaultNonOpaqueConfig;
|
||||
static CDockManager::AutoHideFlags StaticAutoHideConfigFlags; // auto hide feature is disabled by default
|
||||
static QVector<QVariant> StaticConfigParams(CDockManager::ConfigParamCount);
|
||||
|
||||
static QString FloatingContainersTitle;
|
||||
|
||||
@ -1475,6 +1477,20 @@ CDockWidget::DockWidgetFeatures CDockManager::globallyLockedDockWidgetFeatures()
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
void CDockManager::setConfigParam(CDockManager::eConfigParam Param, QVariant Value)
|
||||
{
|
||||
StaticConfigParams[Param] = Value;
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
QVariant CDockManager::configParam(eConfigParam Param, QVariant Default)
|
||||
{
|
||||
return StaticConfigParams[Param].isValid() ? StaticConfigParams[Param] : Default;
|
||||
}
|
||||
|
||||
|
||||
} // namespace ads
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -263,6 +263,15 @@ public:
|
||||
};
|
||||
Q_DECLARE_FLAGS(AutoHideFlags, eAutoHideFlag)
|
||||
|
||||
/**
|
||||
* Global configuration parameters that you can set via setConfigParam()
|
||||
*/
|
||||
enum eConfigParam
|
||||
{
|
||||
AutoHideOpenOnDragHoverDelay_ms, ///< Delay in ms before the dock opens on drag hover if AutoHideOpenOnDragHover flag is set
|
||||
ConfigParamCount // just a delimiter to count number of config params
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Default Constructor.
|
||||
@ -324,6 +333,17 @@ public:
|
||||
*/
|
||||
static bool testAutoHideConfigFlag(eAutoHideFlag Flag);
|
||||
|
||||
/**
|
||||
* Sets the value for the given config parameter
|
||||
*/
|
||||
static void setConfigParam(eConfigParam Param, QVariant Value);
|
||||
|
||||
/**
|
||||
* Returns the value for the given config parameter or the default value
|
||||
* if the parameter is not set.
|
||||
*/
|
||||
static QVariant configParam(eConfigParam Param, QVariant Default);
|
||||
|
||||
/**
|
||||
* Returns the global icon provider.
|
||||
* The icon provider enables the use of custom icons in case using
|
||||
|
Loading…
Reference in New Issue
Block a user