diff --git a/include/FramelessHelper/Quick/framelessquickutils.h b/include/FramelessHelper/Quick/framelessquickutils.h index 45c51049..a2851ff0 100644 --- a/include/FramelessHelper/Quick/framelessquickutils.h +++ b/include/FramelessHelper/Quick/framelessquickutils.h @@ -56,6 +56,7 @@ class FRAMELESSHELPER_QUICK_API FramelessQuickUtils : public QObject, public QQm Q_PROPERTY(QSizeF defaultSystemButtonIconSize READ defaultSystemButtonIconSize CONSTANT FINAL) Q_PROPERTY(QColor defaultSystemButtonBackgroundColor READ defaultSystemButtonBackgroundColor CONSTANT FINAL) Q_PROPERTY(QColor defaultSystemCloseButtonBackgroundColor READ defaultSystemCloseButtonBackgroundColor CONSTANT FINAL) + Q_PROPERTY(bool blurBehindWindowSupported READ blurBehindWindowSupported CONSTANT FINAL) public: explicit FramelessQuickUtils(QObject *parent = nullptr); @@ -74,6 +75,7 @@ class FRAMELESSHELPER_QUICK_API FramelessQuickUtils : public QObject, public QQm Q_NODISCARD QSizeF defaultSystemButtonIconSize() const; Q_NODISCARD QColor defaultSystemButtonBackgroundColor() const; Q_NODISCARD QColor defaultSystemCloseButtonBackgroundColor() const; + Q_NODISCARD bool blurBehindWindowSupported() const; Q_NODISCARD Q_SLOT QColor getSystemButtonBackgroundColor( const QuickGlobal::SystemButtonType button, const QuickGlobal::ButtonState state); diff --git a/src/core/framelessmanager.cpp b/src/core/framelessmanager.cpp index 64bd9fad..53df4e8e 100644 --- a/src/core/framelessmanager.cpp +++ b/src/core/framelessmanager.cpp @@ -142,22 +142,12 @@ bool InternalEventFilter::eventFilter(QObject *object, QEvent *event) if (!data || !data->frameless || !data->callbacks) { return false; } - switch (event->type()) { - case QEvent::WinIdChange: { + if (event->type() == QEvent::WinIdChange) { const WId windowId = data->callbacks->getWindowId(); Q_ASSERT(windowId); if (windowId) { FramelessManagerPrivate::updateWindowId(m_window, windowId); } - } break; - case QEvent::Close: { - const auto ce = static_cast(event); - if (ce->isAccepted()) { - std::ignore = FramelessManager::instance()->removeWindow(m_window); - } - } break; - default: - break; } return false; } diff --git a/src/quick/framelessquickutils.cpp b/src/quick/framelessquickutils.cpp index 06ba473a..432e04da 100644 --- a/src/quick/framelessquickutils.cpp +++ b/src/quick/framelessquickutils.cpp @@ -131,6 +131,11 @@ QColor FramelessQuickUtils::defaultSystemCloseButtonBackgroundColor() const return kDefaultSystemCloseButtonBackgroundColor; } +bool FramelessQuickUtils::blurBehindWindowSupported() const +{ + return Utils::isBlurBehindWindowSupported(); +} + QColor FramelessQuickUtils::getSystemButtonBackgroundColor(const QuickGlobal::SystemButtonType button, const QuickGlobal::ButtonState state) {