-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy paththeme.h
More file actions
54 lines (39 loc) · 1.15 KB
/
theme.h
File metadata and controls
54 lines (39 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef THEME_H
#define THEME_H
#include "std.h"
class Theme : public QObject {
Q_OBJECT
public:
static QString ANDROID_STUDIO, QT_CREATOR, NETBEANS, LIGHT_TABLE, DARK_SODA;
Theme(QObject *parent=0);
static QString current(){ return _theme; }
static QString getDefault();
static QString prevTheme(){ return _prevTheme; }
static bool isCurrent(QString kind) {
return _theme == kind;
}
static void init();
static void set(QString kind, bool setColors=false);
static void adjustDefaultColors(bool emitSignals);
static QIcon icon(QString name);
static QImage imageLight(QString name);
static QImage imageDark(QString name);
static bool isDark();
static Theme* instance() {
static Theme *t = 0;
if(!t)
t = new Theme;
return t;
}
void setLocal(QString kind, bool setColors);
static QStringList allThemes() { return _themes; }
signals:
void beginChange();
void endChange();
private:
static void save(bool setColors);
static QStringList _themes;
static QString _theme, _prevTheme;
static bool _isDark;
};
#endif // THEME_H