matrixion/include/ui/ThemeManager.h

32 lines
534 B
C
Raw Permalink Normal View History

#pragma once
2017-04-06 02:06:42 +03:00
#include <QCommonStyle>
#include "Theme.h"
class ThemeManager : public QCommonStyle
{
2017-09-10 12:59:21 +03:00
Q_OBJECT
2017-04-06 02:06:42 +03:00
public:
2017-09-10 12:59:21 +03:00
inline static ThemeManager &instance();
2017-04-06 02:06:42 +03:00
2017-09-10 12:59:21 +03:00
void setTheme(Theme *theme);
QColor themeColor(const QString &key) const;
2017-04-06 02:06:42 +03:00
private:
2017-09-10 12:59:21 +03:00
ThemeManager();
2017-04-06 02:06:42 +03:00
2017-09-10 12:59:21 +03:00
ThemeManager(ThemeManager const &);
void operator=(ThemeManager const &);
2017-04-06 02:06:42 +03:00
2017-09-10 12:59:21 +03:00
Theme *theme_;
2017-04-06 02:06:42 +03:00
};
2017-08-20 13:47:22 +03:00
inline ThemeManager &
ThemeManager::instance()
2017-04-06 02:06:42 +03:00
{
2017-09-10 12:59:21 +03:00
static ThemeManager instance;
return instance;
2017-04-06 02:06:42 +03:00
}