diff --git a/src/app/main.cpp b/src/app/main.cpp index 4f3dbdd79..f2b55e13b 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -86,6 +86,17 @@ void generateAlphaMesh(QPixmap& alphaMesh, int main(int argc, char *argv[]) { +#ifdef Q_OS_WIN +#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0) + // Set proper window title bar color on Windows + // https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5 + QSettings registry("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", + QSettings::NativeFormat); + if (registry.value("AppsUseLightTheme").toInt() == 0) { qputenv("QT_QPA_PLATFORM", + "windows:darkmode=1"); } +#endif +#endif + #ifdef Q_OS_LINUX // Force XCB on Linux qputenv("QT_QPA_PLATFORM", "xcb");