From d61db440e1c757a656ec2ab91f0c2f39ccd5d5f3 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <zhaoyuhang@rankyee.com> Date: ćšć, 28 12æ 2023 15:19:56 +0800 Subject: [PATCH] minor tweaks --- src/widgets/widgetwindowagent_win.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/widgetwindowagent_win.cpp b/src/widgets/widgetwindowagent_win.cpp index 7340fdb..02ea7e5 100644 --- a/src/widgets/widgetwindowagent_win.cpp +++ b/src/widgets/widgetwindowagent_win.cpp @@ -44,7 +44,7 @@ static QVariant defaultMargins = QVariant::fromValue(QMargins(0, 1, 0, 0)); ctx->setWindowAttribute(QStringLiteral("extra-margins"), defaultMargins); - // Enable dark mode by default, otherwise the frame borders are white + // Enable dark mode by default, otherwise the system borders are white ctx->setWindowAttribute(QStringLiteral("dark-mode"), true); ctx->installNativeEventFilter(this); @@ -111,7 +111,7 @@ // border, and we need to extend the non-client area to the whole title // bar. QRect frame = ctx->windowAttribute(QStringLiteral("title-bar-rect")).toRect(); - QMargins margins{0, -frame.top(), 0, 0}; + QMargins margins{0, frame.top(), 0, 0}; ctx->setWindowAttribute(QStringLiteral("extra-margins"), QVariant::fromValue(margins)); } @@ -119,6 +119,7 @@ bool nativeEventFilter(const QByteArray &eventType, void *message, QT_NATIVE_EVENT_RESULT_TYPE *result) override { Q_UNUSED(eventType) + const auto msg = static_cast<const MSG *>(message); switch (msg->message) { case WM_DPICHANGED: { @@ -163,6 +164,7 @@ bool eventFilter(QObject *obj, QEvent *event) override { Q_UNUSED(obj) + switch (event->type()) { case QEvent::UpdateRequest: { if (!isNormalWindow()) -- Gitblit v1.9.1