60 lines
1.7 KiB
C++
60 lines
1.7 KiB
C++
#ifndef STYLECONTROLLER_H
|
|
#define STYLECONTROLLER_H
|
|
|
|
#include <QObject>
|
|
#include <QColor>
|
|
|
|
class StyleController : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
static StyleController* m_instance;
|
|
StyleController(const StyleController&) = delete;
|
|
StyleController& operator=(const StyleController&) = delete;
|
|
StyleController* Instance();
|
|
|
|
enum COLOR_MODE
|
|
{
|
|
DARK = 0,
|
|
LIGHT,
|
|
SYSTEM
|
|
}
|
|
Q_ENUMS(COLOR_MODE);
|
|
|
|
|
|
Q_PROPERTY(int colorMode READ colorMode WRITE setColorMode NOTIFY colorModeChanged FINAL)
|
|
|
|
//Dark Mode
|
|
Q_PROPERTY(QColor textPrimary READ textPrimary NOTIFY colorChanged FINAL)
|
|
QColor textPrimary() const {return QColor(255,255,255);}
|
|
|
|
Q_PROPERTY(QColor textSecondary READ textSecondary NOTIFY colorChanged FINAL)
|
|
QColor textSecondary() const {return QColor(255,255,255,179);}
|
|
|
|
Q_PROPERTY(QColor textDisabled READ textDisabled NOTIFY colorChanged FINAL)
|
|
QColor textDisabled() const {return QColor(255,255,255,125);}
|
|
|
|
Q_PROPERTY(QColor buttonActive READ buttonActive NOTIFY colorChanged FINAL)
|
|
QColor buttonActive() const {return QColor(255,255,255);}
|
|
|
|
Q_PROPERTY(QColor buttonDisabled READ buttonDisabled NOTIFY colorChanged FINAL)
|
|
QColor buttonDisabled() const {return QColor(255,255,255, 77);}
|
|
|
|
Q_PROPERTY(QColor buttonSelected READ buttonSelected NOTIFY colorChanged FINAL)
|
|
QColor buttonSelected() const {return QColor(255,255,255, 40);}
|
|
|
|
int colorMode() const;
|
|
void setColorMode(int newColorMode);
|
|
|
|
|
|
signals:
|
|
void colorChanged();
|
|
void colorModeChanged();
|
|
|
|
private:
|
|
explicit StyleController(QObject *parent = nullptr);
|
|
int m_colorMode = COLOR_MODE::DARK;
|
|
};
|
|
|
|
#endif // STYLECONTROLLER_H
|