We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b22fbc commit 773c7f7Copy full SHA for 773c7f7
1 file changed
pe-bear/base/MainSettings.cpp
@@ -1,23 +1,15 @@
1
#include "MainSettings.h"
2
#include <QPalette>
3
-#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
4
- #include <QStyleHints>
5
-#endif
6
#include "../gui/DarkStyle.h"
7
#define DARK_STYLE_NAME "Dark"
8
9
//--------------------
10
inline bool isDarkMode()
11
{
12
13
- const auto scheme = QGuiApplication::styleHints()->colorScheme();
14
- return scheme == Qt::ColorScheme::Dark;
15
-#else
16
const QPalette defaultPalette;
17
const auto text = defaultPalette.color(QPalette::WindowText);
18
const auto window = defaultPalette.color(QPalette::Window);
19
return text.lightness() > window.lightness();
20
-#endif // QT_VERSION
21
}
22
//---
23
0 commit comments