Mercurial > minori
comparison src/sys/win32/dark_theme.cpp @ 66:6481c5aed3e1
posters: add poster widget...
why does AniList call these cover images? they're posters...
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Mon, 02 Oct 2023 05:56:32 -0400 |
| parents | cde8f67a7c7d |
| children |
comparison
equal
deleted
inserted
replaced
| 65:26721c28bf22 | 66:6481c5aed3e1 |
|---|---|
| 5 namespace win32 { | 5 namespace win32 { |
| 6 | 6 |
| 7 bool DarkThemeAvailable() { | 7 bool DarkThemeAvailable() { |
| 8 // dark mode supported Windows 10 1809 10.0.17763 onward | 8 // dark mode supported Windows 10 1809 10.0.17763 onward |
| 9 // https://stackoverflow.com/questions/53501268/win10-dark-theme-how-to-use-in-winapi | 9 // https://stackoverflow.com/questions/53501268/win10-dark-theme-how-to-use-in-winapi |
| 10 if (QOperatingSystemVersion::current().majorVersion() == 10) { | 10 const auto& ver = QOperatingSystemVersion::current(); |
| 11 return QOperatingSystemVersion::current().microVersion() >= 17763; | 11 return (ver.majorVersion() > 10) ? true : (ver.majorVersion() == 10 && ver.microVersion() >= 17763); |
| 12 } else if (QOperatingSystemVersion::current().majorVersion() > 10) { | |
| 13 return true; | |
| 14 } else { | |
| 15 return false; | |
| 16 } | |
| 17 } | 12 } |
| 18 | 13 |
| 19 bool IsInDarkTheme() { | 14 bool IsInDarkTheme() { |
| 20 QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", | 15 QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", |
| 21 QSettings::NativeFormat); | 16 QSettings::NativeFormat); |
