diff --git a/src/DockManager.cpp b/src/DockManager.cpp index 06ed8cd..e7aabb3 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #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 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 //--------------------------------------------------------------------------- diff --git a/src/DockManager.h b/src/DockManager.h index e56e9ac..9edb8e8 100644 --- a/src/DockManager.h +++ b/src/DockManager.h @@ -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