2017-09-28 10:12:30 +00:00
|
|
|
#ifndef QTMATERIALSTYLE_H
|
|
|
|
#define QTMATERIALSTYLE_H
|
|
|
|
|
|
|
|
#include "lib/qtmaterialstyle_p.h"
|
2022-07-05 07:49:55 +00:00
|
|
|
#include <QtWidgets/QCommonStyle>
|
2017-09-28 10:12:30 +00:00
|
|
|
|
2022-07-05 07:49:55 +00:00
|
|
|
#define MATERIAL_DISABLE_THEME_COLORS \
|
|
|
|
if (d->useThemeColors == true) { \
|
|
|
|
d->useThemeColors = false; \
|
|
|
|
}
|
2017-09-29 07:19:04 +00:00
|
|
|
|
2017-09-28 10:12:30 +00:00
|
|
|
class QtMaterialTheme;
|
|
|
|
|
|
|
|
class QtMaterialStyle : public QCommonStyle
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline static QtMaterialStyle &instance();
|
|
|
|
|
|
|
|
void setTheme(QtMaterialTheme *theme);
|
|
|
|
QColor themeColor(const QString &key) const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
const QScopedPointer<QtMaterialStylePrivate> d_ptr;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(QtMaterialStyle)
|
|
|
|
|
|
|
|
QtMaterialStyle();
|
|
|
|
|
|
|
|
QtMaterialStyle(QtMaterialStyle const &);
|
|
|
|
void operator=(QtMaterialStyle const &);
|
|
|
|
};
|
|
|
|
|
|
|
|
inline QtMaterialStyle &QtMaterialStyle::instance()
|
|
|
|
{
|
|
|
|
static QtMaterialStyle instance;
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
2022-07-05 07:49:55 +00:00
|
|
|
#endif // QTMATERIALSTYLE_H
|