Mercurial > minori
annotate src/sys/win32/dark_theme.cpp @ 75:d3e9310598b1
*: refactor some stuff
text: "TextParagraph"s are now called sections, because that's the
actual word for it :P
text: new classes: Line and OneLineSection, solves many problems with
paragraphs that are only one line long (ex. going out of bounds)
http: reworked http stuff to allow threaded get requests, also moved it
to its own file to (hopefully) remove clutter
eventually I'll make a threaded post request method and use that in
the "basic" function
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Wed, 04 Oct 2023 01:42:30 -0400 |
| parents | 6481c5aed3e1 |
| children |
| rev | line source |
|---|---|
| 9 | 1 #include "sys/win32/dark_theme.h" |
| 2 | 2 #include <QOperatingSystemVersion> |
| 9 | 3 #include <QSettings> |
| 4 | |
| 5 namespace win32 { | |
| 6 | |
| 7 bool DarkThemeAvailable() { | |
| 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 | |
|
66
6481c5aed3e1
posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
10 const auto& ver = QOperatingSystemVersion::current(); |
|
6481c5aed3e1
posters: add poster widget...
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
11 return (ver.majorVersion() > 10) ? true : (ver.majorVersion() == 10 && ver.microVersion() >= 17763); |
| 2 | 12 } |
| 13 | |
| 9 | 14 bool IsInDarkTheme() { |
| 15 | 15 QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", |
| 16 QSettings::NativeFormat); | |
| 9 | 17 return settings.value("AppsUseLightTheme", 1).toInt() == 0; |
| 2 | 18 } |
| 9 | 19 |
| 20 } // namespace win32 |
