diff --git a/src/libs/vmisc/theme/vtheme.cpp b/src/libs/vmisc/theme/vtheme.cpp index 5da45f933..f49421615 100644 --- a/src/libs/vmisc/theme/vtheme.cpp +++ b/src/libs/vmisc/theme/vtheme.cpp @@ -217,13 +217,60 @@ void ActivateCustomDarkTheme() } } +//--------------------------------------------------------------------------------------------------------------------- +#if defined(Q_OS_WIN) +void ActivateDefaultThemeWin() +{ +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + qApp->setStyleSheet(QString()); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) +#else + if (VTheme::IsInDarkTheme()) + { + ActivateCustomDarkTheme(); + } + else + { + ActivateCustomLightTheme(); + } +#endif // QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) +} +#endif // defined(Q_OS_WIN) + +//--------------------------------------------------------------------------------------------------------------------- +#if defined(Q_OS_MACX) +void ActivateDefaultThemeMac() +{ +#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) + qApp->setStyleSheet(QString()); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) +#else + if (VTheme::IsInDarkTheme()) + { + ActivateCustomDarkTheme(); + } + else + { + ActivateCustomLightTheme(); + } +#endif // QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) +} +#endif // defined(Q_OS_MACX) + //--------------------------------------------------------------------------------------------------------------------- void ActivateDefaultTheme() { - qApp->setStyleSheet(QString()); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) - -#if defined(Q_OS_MACX) - NSMacSetToAutoTheme(); +#if defined(Q_OS_WIN) + ActivateDefaultThemeWin(); +#elif defined(Q_OS_MACX) + ActivateDefaultThemeMac(); +#else + if (VTheme::IsInDarkTheme()) + { + ActivateCustomDarkTheme(); + } + else + { + ActivateCustomLightTheme(); + } #endif } @@ -466,10 +513,6 @@ void VTheme::InitThemeMode() { ActivateCustomDarkTheme(); } - else - { - ActivateCustomLightTheme(); - } } } }