diff --git a/CHANGES.md b/CHANGES.md index fb20582..86c0fae 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,6 @@ # Changes +- (2024-04-23) Support for dark/light colorSchema mode, (contribution by @hanjianqiao(Lanchitour)) - (2023-12-07) Update to 6.5.1, Sharp Thin Pro font - (2023-08-16) Update to 6.4.2, Fix issue missing pro icons in namedCodePoints - (2023-03-28) Update to 6.4.0, Sharp Light Pro font diff --git a/QtAwesome/QtAwesome.cpp b/QtAwesome/QtAwesome.cpp index 688e7d8..7a19bd1 100644 --- a/QtAwesome/QtAwesome.cpp +++ b/QtAwesome/QtAwesome.cpp @@ -3,7 +3,7 @@ * * MIT Licensed * - * Copyright 2013-2022 - Reliable Bits Software by Blommers IT. All Rights Reserved. + * Copyright 2013-2024 - Reliable Bits Software by Blommers IT. All Rights Reserved. * Author Rick Blommers */ @@ -17,9 +17,13 @@ #include #include #include -#include +#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)) +#define USE_COLOR_SCHEME +#include +#endif + // Initializing namespaces need to happen outside a namespace static void qtawesome_init_resources() { @@ -247,10 +251,12 @@ QtAwesome::QtAwesome(QObject* parent) _fontDetails.insert(fa::fa_sharp_thin, QtAwesomeFontData(FA_SHARP_THIN_FONT_FILENAME, FA_SHARP_THIN_FONT_WEIGHT)); #endif - // support dark/light mode +#ifdef USE_COLOR_SCHEME + // support dark/light mode QObject::connect(QApplication::styleHints(), &QStyleHints::colorSchemeChanged, this, [this](Qt::ColorScheme colorScheme){ resetDefaultOptions(); }); +#endif } void QtAwesome::resetDefaultOptions(){ diff --git a/QtAwesome/QtAwesome.h b/QtAwesome/QtAwesome.h index ad01764..c1ec3c8 100644 --- a/QtAwesome/QtAwesome.h +++ b/QtAwesome/QtAwesome.h @@ -3,7 +3,7 @@ * * MIT Licensed * - * Copyright 2013-2022 - Reliable Bits Software by Blommers IT. All Rights Reserved. + * Copyright 2013-2024 - Reliable Bits Software by Blommers IT. All Rights Reserved. * Author Rick Blommers */