Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwenx190 committed Nov 2, 2023
1 parent 33a6f0d commit 79a9327
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 2 additions & 0 deletions include/FramelessHelper/Quick/framelessquickutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
12 changes: 1 addition & 11 deletions src/core/framelessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const QCloseEvent *>(event);
if (ce->isAccepted()) {
std::ignore = FramelessManager::instance()->removeWindow(m_window);
}
} break;
default:
break;
}
return false;
}
Expand Down
5 changes: 5 additions & 0 deletions src/quick/framelessquickutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 79a9327

Please sign in to comment.