2017-09-28 10:12:30 +00:00
|
|
|
#ifndef QTMATERIALSTYLE_H
|
|
|
|
#define QTMATERIALSTYLE_H
|
|
|
|
|
2017-09-28 12:52:06 +00:00
|
|
|
#include <QtWidgets/QCommonStyle>
|
2017-09-28 10:12:30 +00:00
|
|
|
#include "lib/qtmaterialstyle_p.h"
|
|
|
|
|
2017-09-29 07:19:04 +00:00
|
|
|
#define MATERIAL_DISABLE_THEME_COLORS \
|
|
|
|
if (d->useThemeColors == true) { d->useThemeColors = false; }
|
|
|
|
|
2022-02-17 01:59:33 +00:00
|
|
|
namespace md
|
|
|
|
{
|
|
|
|
class Theme;
|
2017-09-28 10:12:30 +00:00
|
|
|
|
2022-02-17 01:59:33 +00:00
|
|
|
class Style : public QCommonStyle
|
2017-09-28 10:12:30 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-02-17 01:59:33 +00:00
|
|
|
inline static Style &instance();
|
2017-09-28 10:12:30 +00:00
|
|
|
|
2022-02-17 01:59:33 +00:00
|
|
|
void setTheme(Theme *theme);
|
2017-09-28 10:12:30 +00:00
|
|
|
QColor themeColor(const QString &key) const;
|
|
|
|
|
|
|
|
protected:
|
2022-02-17 01:59:33 +00:00
|
|
|
const QScopedPointer<StylePrivate> d_ptr;
|
2017-09-28 10:12:30 +00:00
|
|
|
|
|
|
|
private:
|
2022-02-17 01:59:33 +00:00
|
|
|
Q_DECLARE_PRIVATE(Style)
|
2017-09-28 10:12:30 +00:00
|
|
|
|
2022-02-17 01:59:33 +00:00
|
|
|
Style();
|
2017-09-28 10:12:30 +00:00
|
|
|
|
2022-02-17 01:59:33 +00:00
|
|
|
Style(Style const &);
|
|
|
|
void operator=(Style const &);
|
2017-09-28 10:12:30 +00:00
|
|
|
};
|
|
|
|
|
2022-02-17 01:59:33 +00:00
|
|
|
inline Style &Style::instance()
|
2017-09-28 10:12:30 +00:00
|
|
|
{
|
2022-02-17 01:59:33 +00:00
|
|
|
static Style instance;
|
2017-09-28 10:12:30 +00:00
|
|
|
return instance;
|
|
|
|
}
|
2022-02-17 01:59:33 +00:00
|
|
|
}
|
2017-09-28 10:12:30 +00:00
|
|
|
|
|
|
|
#endif // QTMATERIALSTYLE_H
|