qskinny/skins/material3/QskMaterial3Skin.h
2022-07-05 08:46:51 +02:00

109 lines
2.2 KiB
C++

/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#ifndef QSK_MATERIAL3_SKIN_H
#define QSK_MATERIAL3_SKIN_H
#include "QskMaterial3Global.h"
#include <QskHctColor.h>
#include <QskSkin.h>
#include <QskShadowMetrics.h>
#include <array>
class QSK_MATERIAL3_EXPORT QskMaterial3Theme
{
public:
enum Lightness
{
Light,
Dark
};
enum PaletteType
{
Primary,
Secondary,
Tertiary,
Error,
Neutral,
NeutralVariant,
NumPaletteTypes
};
QskMaterial3Theme( Lightness );
QskMaterial3Theme( Lightness, std::array< QskHctColor, NumPaletteTypes > );
QRgb primary;
QColor primary12;
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;
QColor onSurface12;
QColor onSurface38;
QRgb surfaceVariant;
QColor surfaceVariant12;
QRgb onSurfaceVariant;
QRgb outline;
QRgb shadow;
QskShadowMetrics elevationLight1;
QskShadowMetrics elevationLight2;
const qreal hoverOpacity = 0.08;
const qreal focusOpacity = 0.12;
const qreal pressedOpacity = 0.12;
const qreal draggedOpacity = 0.16;
private:
std::array< QskHctColor, NumPaletteTypes > m_palettes;
};
class QSK_MATERIAL3_EXPORT QskMaterial3Skin : public QskSkin
{
Q_OBJECT
using Inherited = QskSkin;
public:
QskMaterial3Skin( const QskMaterial3Theme&, QObject* parent = nullptr );
~QskMaterial3Skin() override;
enum FontRole
{
M3BodyLarge = QskSkin::HugeFont + 1,
M3LabelLarge,
};
private:
void setupFonts();
};
#endif