mirror of
https://github.com/gamecreature/QtAwesome.git
synced 2024-11-15 13:35:44 +08:00
updated changes, and add conditionals for supporting older qt versions
This commit is contained in:
parent
1381b93aed
commit
f8e9194672
@ -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
|
||||
|
@ -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 <QFontDatabase>
|
||||
#include <QFontMetrics>
|
||||
#include <QString>
|
||||
#include <QStyleHints>
|
||||
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
||||
#define USE_COLOR_SCHEME
|
||||
#include <QStyleHints>
|
||||
#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(){
|
||||
|
@ -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
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user