CustomFrame: Move the features enum up 1 level

This commit is contained in:
Sergio Martins
2021-02-18 14:40:20 +00:00
parent 52ce80fd97
commit b5043b2b87
2 changed files with 13 additions and 13 deletions

View File

@@ -605,8 +605,8 @@ bool CustomFrameHelper::nativeEventFilter(const QByteArray &eventType, void *mes
if (!window)
return false;
const Features features = m_shouldUseCustomFrameFunc(window);
if (features == Feature_None) {
const WidgetResizeHandler::Features features = m_shouldUseCustomFrameFunc(window);
if (!features) {
// No native support for is desired for this window
return false;
}

View File

@@ -31,11 +31,21 @@ namespace KDDockWidgets {
class FloatingWindow;
class DOCKS_EXPORT WidgetResizeHandler : public QObject
{
Q_OBJECT
public:
enum Feature {
Feature_None = 0,
Feature_NativeShadow = 1,
Feature_NativeResize = 2,
Feature_NativeDrag = 4,
Feature_NativeMaximize = 8
};
Q_DECLARE_FLAGS(Features, Feature);
/**
* @brief CTOR
* @param isTopLevelResizer If true, then this resize handler is for top-level widgets (aka windows)
@@ -130,17 +140,7 @@ class DOCKS_EXPORT CustomFrameHelper
{
Q_OBJECT
public:
enum Feature {
Feature_None = 0,
Feature_NativeShadow = 1,
Feature_NativeResize = 2,
Feature_NativeDrag = 4,
Feature_NativeMaximize = 8
};
Q_DECLARE_FLAGS(Features, Feature);
typedef Features (*ShouldUseCustomFrame)(QWindow *);
typedef WidgetResizeHandler::Features (*ShouldUseCustomFrame)(QWindow *);
explicit CustomFrameHelper(ShouldUseCustomFrame shouldUseCustomFrameFunc,
QObject *parent = nullptr);
~CustomFrameHelper() override;