From 46285db399f75154ad6c451e12f2cae2e59ace25 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周日, 24 12月 2023 23:52:03 +0800 Subject: [PATCH] Use brilliant workaround to show Windows 10 top border --- examples/mainwindow/mainwindow.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/mainwindow/mainwindow.cpp b/examples/mainwindow/mainwindow.cpp index 8c224f3..a1a39dd 100644 --- a/examples/mainwindow/mainwindow.cpp +++ b/examples/mainwindow/mainwindow.cpp @@ -115,6 +115,10 @@ windowAgent = new QWK::WidgetWindowAgent(this); windowAgent->setup(this); +#ifdef Q_OS_WIN + windowAgent->setWindowAttribute(QStringLiteral("dark-mode"), true); +#endif + // 2. Construct your title bar auto menuBar = [this]() { auto menuBar = new QMenuBar(); @@ -298,10 +302,6 @@ if (!styleSheet().isEmpty() && theme == currentTheme) return; currentTheme = theme; - -#ifdef Q_OS_WIN - windowAgent->setWindowAttribute(QStringLiteral("dark-mode"), currentTheme == Dark); -#endif if (QFile qss(theme == Dark ? QStringLiteral(":/dark-style.qss") : QStringLiteral(":/light-style.qss")); -- Gitblit v1.9.1