Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Set proper window title bar color #962

Merged
merged 2 commits into from
Apr 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions App/NatronApp_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ int main(int argc, char *argv[])
freopen("CONOUT$", "w", stderr);
}
}
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
// Set window title bar color based on dark/light theme
// https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5
// https://learn.microsoft.com/en-us/answers/questions/1161597/how-to-detect-windows-application-dark-mode
QSettings registry(QString::fromUtf8("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"),
QSettings::NativeFormat);
if (registry.value(QString::fromUtf8("AppsUseLightTheme"), 0).toInt() == 0) {
qputenv("QT_QPA_PLATFORM", "windows:darkmode=1");
}
#endif
#endif

#if defined(Q_OS_UNIX) && defined(RLIMIT_NOFILE)
Expand Down