diff --git a/src/theme.cpp b/src/theme.cpp index 7043ab9fc7..d87aa21f34 100644 --- a/src/theme.cpp +++ b/src/theme.cpp @@ -6,6 +6,10 @@ #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) +# include +# include +#endif #include "leakdetector.h" #include "logger.h" @@ -181,6 +185,15 @@ QVariant Theme::data(const QModelIndex& index, int role) const { } } +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) +Qt::ColorScheme Theme::currentSystemTheme() { + QStyleHints* styleHints = QGuiApplication::styleHints(); + Qt::ColorScheme currentColorScheme = styleHints->colorScheme(); + logger.debug() << "Current system theme: " << currentColorScheme; + return currentColorScheme; +} +#endif + void Theme::setStatusBarTextColor([[maybe_unused]] StatusBarTextColor color) { #ifdef MZ_IOS IOSCommons::setStatusBarTextColor(color); diff --git a/src/theme.h b/src/theme.h index 621dea5c2d..3ddabcd06b 100644 --- a/src/theme.h +++ b/src/theme.h @@ -46,6 +46,10 @@ class Theme final : public QAbstractListModel { QVariant data(const QModelIndex& index, int role) const override; +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + Qt::ColorScheme currentSystemTheme(); +#endif + enum StatusBarTextColor { StatusBarTextColorLight, StatusBarTextColorDark,