mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Check high contrast theme for auto dark mode on Windows
This commit is contained in:
parent
8534cf3756
commit
5f5a2a3ef2
1 changed files with 7 additions and 0 deletions
|
@ -399,6 +399,13 @@ std::optional<bool> IsDarkMode() {
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HIGHCONTRAST hcf = {};
|
||||||
|
hcf.cbSize = static_cast<UINT>(sizeof(HIGHCONTRAST));
|
||||||
|
if (SystemParametersInfo(SPI_GETHIGHCONTRAST, hcf.cbSize, &hcf, FALSE)
|
||||||
|
&& (hcf.dwFlags & HCF_HIGHCONTRASTON)) {
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
const auto keyName = L""
|
const auto keyName = L""
|
||||||
"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize";
|
"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize";
|
||||||
const auto valueName = L"AppsUseLightTheme";
|
const auto valueName = L"AppsUseLightTheme";
|
||||||
|
|
Loading…
Add table
Reference in a new issue