FluentUI/src/FluTheme.h

30 lines
702 B
C
Raw Normal View History

2023-03-06 14:22:13 +08:00
#ifndef FLUTHEME_H
#define FLUTHEME_H
#include <QObject>
#include "FluColorSet.h"
#include "stdafx.h"
class FluTheme : public QObject
{
Q_OBJECT
2023-04-19 23:53:00 +08:00
Q_PROPERTY(bool dark READ dark NOTIFY darkChanged)
2023-03-06 14:22:13 +08:00
Q_PROPERTY_AUTO(FluColorSet*,primaryColor)
2023-03-28 21:37:10 +08:00
Q_PROPERTY_AUTO(bool,frameless);
2023-04-19 23:53:00 +08:00
Q_PROPERTY_AUTO(int,darkMode);
2023-03-28 21:37:10 +08:00
Q_PROPERTY_AUTO(bool,nativeText);
2023-03-09 23:11:59 +08:00
Q_PROPERTY_AUTO(int,textSize);
2023-03-06 14:22:13 +08:00
public:
explicit FluTheme(QObject *parent = nullptr);
static FluTheme *getInstance();
2023-04-19 23:53:00 +08:00
bool dark();
Q_SIGNAL void darkChanged();
2023-03-06 14:22:13 +08:00
private:
static FluTheme* m_instance;
2023-04-19 23:53:00 +08:00
bool _dark;
bool eventFilter(QObject *obj, QEvent *event);
2023-04-19 23:53:00 +08:00
bool systemDark();
2023-03-06 14:22:13 +08:00
};
#endif // FLUTHEME_H