mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-10 10:31:39 +01:00
JBR-2667 Add new AWT desktop property for light/dark theme detection on Windows 10
(cherry picked from commit0e4ad056dd) (cherry picked from commite5dfcc4417)
This commit is contained in:
committed by
jbrbot
parent
4561cbe176
commit
6adc1916da
@@ -695,6 +695,20 @@ void AwtDesktopProperties::GetOtherParameters() {
|
||||
}
|
||||
free(value);
|
||||
}
|
||||
|
||||
// Add property for light/dark theme detection
|
||||
value = getWindowsPropFromReg(TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"),
|
||||
TEXT("AppsUseLightTheme"), &valueType);
|
||||
if (value != NULL) {
|
||||
if (valueType == REG_DWORD) {
|
||||
SetBooleanProperty(TEXT("win.darkTheme.on"), (BOOL)((int)*value == 0));
|
||||
}
|
||||
free(value);
|
||||
}
|
||||
else {
|
||||
SetBooleanProperty(TEXT("win.darkTheme.on"), FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
catch (std::bad_alloc&) {
|
||||
if (value != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user