Skip to content

Commit

Permalink
Merge pull request #962 from rodlie/RB-2.6-titlebar
Browse files Browse the repository at this point in the history
Windows: Set proper window title bar color
  • Loading branch information
rodlie authored Apr 20, 2024
2 parents 6e28f2a + 3ced97f commit 604d697
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 604d697

Please sign in to comment.