macOS: use QStyleHint to get color scheme in the style
That way, an override through QStyleHints::setColorScheme is immediately respected by the style. As a drive-by, make the helper static and inline. Change-Id: Ia6cde1f5099d9194b25fac812c3184f5a61bf1dc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 4245987f6875d01853053c50d13ecf42b61fc0ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>bb10
parent
450cd772e2
commit
ea8277dbf3
|
|
@ -21,6 +21,7 @@
|
|||
#include <QtCore/private/qcore_mac_p.h>
|
||||
|
||||
#include <QtGui/qpainterpath.h>
|
||||
#include <QtGui/qstylehints.h>
|
||||
#include <QtGui/private/qcoregraphics_p.h>
|
||||
#include <QtGui/qpa/qplatformfontdatabase.h>
|
||||
#include <QtGui/qpa/qplatformtheme.h>
|
||||
|
|
@ -160,7 +161,10 @@ const int pushButtonBevelRectOffsets[3] = {
|
|||
|
||||
QVector<QPointer<QObject> > QMacStylePrivate::scrollBars;
|
||||
|
||||
bool isDarkMode() { return QGuiApplicationPrivate::platformTheme()->colorScheme() == Qt::ColorScheme::Dark; }
|
||||
static inline bool isDarkMode()
|
||||
{
|
||||
return QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark;
|
||||
}
|
||||
|
||||
#if QT_CONFIG(tabwidget)
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue