qskinny/skins/material3/QskMaterial3Skin.h

118 lines
2.3 KiB
C
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
2022-07-06 14:48:06 +02:00
* QSkinny - Copyright (C) 2022 Edelhirsch Software GmbH
* This file may be used under the terms of the 3-clause BSD License
2017-07-21 18:21:34 +02:00
*****************************************************************************/
2022-07-05 08:36:25 +02:00
#ifndef QSK_MATERIAL3_SKIN_H
#define QSK_MATERIAL3_SKIN_H
2017-07-21 18:21:34 +02:00
2022-07-05 08:36:25 +02:00
#include "QskMaterial3Global.h"
2022-06-27 14:32:37 +02:00
#include <QskHctColor.h>
2017-07-21 18:21:34 +02:00
#include <QskSkin.h>
#include <QskShadowMetrics.h>
2017-07-21 18:21:34 +02:00
2022-06-14 11:26:12 +02:00
#include <array>
2022-07-05 08:36:25 +02:00
class QSK_MATERIAL3_EXPORT QskMaterial3Theme
2022-02-17 21:54:56 +01:00
{
public:
enum Lightness
{
Light,
Dark
};
enum PaletteType
{
Primary,
Secondary,
Tertiary,
Error,
Neutral,
NeutralVariant,
NumPaletteTypes
};
2022-07-05 08:36:25 +02:00
QskMaterial3Theme( Lightness );
QskMaterial3Theme( Lightness, std::array< QskHctColor, NumPaletteTypes > );
2022-02-17 21:54:56 +01:00
QRgb primary;
2022-06-17 17:37:44 +02:00
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;
QColor surface1;
QColor surface2;
QColor surface3;
QColor surface4;
QColor surface5;
QRgb onSurface;
2022-06-17 17:37:44 +02:00
QColor onSurface12;
QColor onSurface38;
QRgb surfaceVariant;
2022-06-17 17:37:44 +02:00
QColor surfaceVariant12;
QRgb onSurfaceVariant;
QRgb outline;
2022-06-13 12:54:17 +02:00
QRgb shadow;
QskShadowMetrics elevationLight1;
QskShadowMetrics elevationLight2;
2022-07-05 16:15:00 +02:00
QskShadowMetrics elevationLight3;
const qreal hoverOpacity = 0.08;
const qreal focusOpacity = 0.12;
const qreal pressedOpacity = 0.12;
const qreal draggedOpacity = 0.16;
private:
2022-06-27 14:32:37 +02:00
std::array< QskHctColor, NumPaletteTypes > m_palettes;
2022-02-17 21:54:56 +01:00
};
2022-07-05 08:36:25 +02:00
class QSK_MATERIAL3_EXPORT QskMaterial3Skin : public QskSkin
2017-07-21 18:21:34 +02:00
{
Q_OBJECT
using Inherited = QskSkin;
2018-08-03 08:15:28 +02:00
public:
2022-07-05 08:36:25 +02:00
QskMaterial3Skin( const QskMaterial3Theme&, QObject* parent = nullptr );
~QskMaterial3Skin() override;
2022-06-07 12:40:21 +02:00
enum FontRole
{
M3BodyMedium = QskSkin::HugeFont + 1,
M3BodyLarge,
2022-07-05 16:15:00 +02:00
M3HeadlineSmall,
2022-06-13 15:36:06 +02:00
M3LabelLarge,
2022-06-07 12:40:21 +02:00
};
private:
void setupFonts();
2017-07-21 18:21:34 +02:00
};
#endif