nheko/include/ui/ThemeManager.h

32 lines
534 B
C
Raw Normal View History

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