QskSkin::ColorScheme with scoped value names
This commit is contained in:
parent
620fff1206
commit
9e7e52898e
|
@ -28,12 +28,12 @@ QskSkin* QskFluent2SkinFactory::createSkin( const QString& skinName )
|
|||
{
|
||||
if ( QString::compare( skinName, fluent2LightSkinName, Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
QskFluent2Theme theme( QskSkin::Light );
|
||||
QskFluent2Theme theme( QskSkin::LightScheme );
|
||||
return new QskFluent2Skin( theme );
|
||||
}
|
||||
else if ( QString::compare( skinName, fluent2DarkSkinName, Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
QskFluent2Theme theme( QskSkin::Dark );
|
||||
QskFluent2Theme theme( QskSkin::DarkScheme );
|
||||
return new QskFluent2Skin( theme );
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ QskFluent2Theme::QskFluent2Theme( QskSkin::ColorScheme colorScheme )
|
|||
QskFluent2Theme::QskFluent2Theme( QskSkin::ColorScheme colorScheme,
|
||||
const std::array< QRgb, NumAccentColors >& accentColors )
|
||||
{
|
||||
if( colorScheme == QskSkin::Light )
|
||||
if( colorScheme == QskSkin::LightScheme )
|
||||
{
|
||||
// Fill color:
|
||||
|
||||
|
@ -133,7 +133,7 @@ QskFluent2Theme::QskFluent2Theme( QskSkin::ColorScheme colorScheme,
|
|||
// ### should actually be drawn twice with different values:
|
||||
shadow.dialog = { QskShadowMetrics( 0, 21, QPointF( 0, 2 ) ), rgbGray( 0, 0.1474 ) };
|
||||
}
|
||||
else if( colorScheme == QskSkin::Dark )
|
||||
else if( colorScheme == QskSkin::DarkScheme )
|
||||
{
|
||||
// Fill color:
|
||||
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
#include <QStyleHints>
|
||||
|
||||
static const int qskDuration = 150;
|
||||
|
||||
|
@ -1210,7 +1209,7 @@ QskMaterial3Theme::QskMaterial3Theme( QskSkin::ColorScheme colorScheme,
|
|||
std::array< QskHctColor, NumPaletteTypes > palettes )
|
||||
: m_palettes( palettes )
|
||||
{
|
||||
if ( colorScheme == QskSkin::Light )
|
||||
if ( colorScheme == QskSkin::LightScheme )
|
||||
{
|
||||
primary = m_palettes[ Primary ].toned( 40 ).rgb();
|
||||
onPrimary = m_palettes[ Primary ].toned( 100 ).rgb();
|
||||
|
@ -1244,7 +1243,7 @@ QskMaterial3Theme::QskMaterial3Theme( QskSkin::ColorScheme colorScheme,
|
|||
|
||||
shadow = m_palettes[ Neutral ].toned( 0 ).rgb();
|
||||
}
|
||||
else if ( colorScheme == QskSkin::Dark )
|
||||
else if ( colorScheme == QskSkin::DarkScheme )
|
||||
{
|
||||
primary = m_palettes[ Primary ].toned( 80 ).rgb();
|
||||
onPrimary = m_palettes[ Primary ].toned( 20 ).rgb();
|
||||
|
|
|
@ -27,12 +27,12 @@ QskSkin* QskMaterial3SkinFactory::createSkin( const QString& skinName )
|
|||
{
|
||||
if ( QString::compare( skinName, materialLightSkinName, Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
QskMaterial3Theme theme( QskSkin::Light );
|
||||
QskMaterial3Theme theme( QskSkin::LightScheme );
|
||||
return new QskMaterial3Skin( theme );
|
||||
}
|
||||
else if ( QString::compare( skinName, materialDarkSkinName, Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
QskMaterial3Theme theme( QskSkin::Dark );
|
||||
QskMaterial3Theme theme( QskSkin::DarkScheme );
|
||||
return new QskMaterial3Skin( theme );
|
||||
}
|
||||
|
||||
|
|
|
@ -50,10 +50,12 @@ class QSK_EXPORT QskSkin : public QObject
|
|||
// Use Qt::ColorScheme once minimum version is Qt 6.5
|
||||
enum ColorScheme
|
||||
{
|
||||
Unknown,
|
||||
Light,
|
||||
Dark
|
||||
UnknownScheme,
|
||||
|
||||
LightScheme,
|
||||
DarkScheme
|
||||
};
|
||||
Q_ENUM( ColorScheme )
|
||||
#endif
|
||||
|
||||
QskSkin( QObject* parent = nullptr );
|
||||
|
|
|
@ -8,14 +8,17 @@
|
|||
|
||||
#include <qdir.h>
|
||||
#include <qglobalstatic.h>
|
||||
#include <qguiapplication.h>
|
||||
#include <qjsonarray.h>
|
||||
#include <qjsonobject.h>
|
||||
#include <qmap.h>
|
||||
#include <qpluginloader.h>
|
||||
#include <qpointer.h>
|
||||
#include <qset.h>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 6, 5, 0 )
|
||||
#include <qguiapplication.h>
|
||||
#include <qstylehints.h>
|
||||
#endif
|
||||
|
||||
static inline QStringList qskSplitPath( const QString& s )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue