minor tweaks
This commit is contained in:
parent
33a6f0df91
commit
79a9327c01
|
@ -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 @@ public:
|
|||
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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue