/****************************************************************************** * QSkinny - Copyright (C) 2016 Uwe Rathmann * This file may be used under the terms of the QSkinny License, Version 1.0 *****************************************************************************/ #ifndef QSK_MATERIAL_SKIN_H #define QSK_MATERIAL_SKIN_H #include "QskMaterialGlobal.h" #include #include class QSK_MATERIAL_EXPORT QskMaterialTheme { public: enum Lightness { Light, Dark }; enum PaletteType { Primary, Secondary, Tertiary, Error, Neutral, NeutralVariant, NumPaletteTypes }; QskMaterialTheme( Lightness ); QskMaterialTheme( Lightness, std::array< QskRgbPalette, NumPaletteTypes > ); QRgb primary; QRgb onPrimary; QRgb primaryContainer; QRgb onPrimaryContainer; QRgb secondary; QRgb onSecondary; QRgb secondaryContainer; QRgb onSecondaryContainer; QRgb tertiary; QRgb onTertiary; QRgb tertiaryContainer; QRgb onTertiaryContainer; QRgb error; QRgb onError; QRgb errorContainer; QRgb onErrorContainer; QRgb background; QRgb onBackground; QRgb surface; QRgb onSurface; QRgb surfaceVariant; QRgb onSurfaceVariant; QRgb outline; const qreal hoverOpacity = 0.08; const qreal focusOpacity = 0.12; const qreal pressedOpacity = 0.12; const qreal draggedOpacity = 0.16; std::array< QskRgbPalette, NumPaletteTypes > palettes() const; void setPalette( PaletteType type, const QskRgbPalette& palette ); private: void initColors(); std::array< QskRgbPalette, NumPaletteTypes > m_palettes; Lightness m_lightness; }; class QSK_MATERIAL_EXPORT QskMaterialSkin : public QskSkin { Q_OBJECT using Inherited = QskSkin; public: QskMaterialSkin( const QskMaterialTheme&, QObject* parent = nullptr ); ~QskMaterialSkin() override; enum FontRole { M3LabelLarge = QskSkin::HugeFont + 1, }; void setPalette( QskMaterialTheme::PaletteType, const QskRgbPalette& palette ); private: void init( const QskMaterialTheme& palette ); void setupFonts(); QskMaterialTheme m_theme; }; #endif