-
-
Notifications
You must be signed in to change notification settings - Fork 144
/
themeprovider.h
36 lines (30 loc) · 985 Bytes
/
themeprovider.h
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
#pragma once
#define THEME_ICON(n) ThemeProvider::icon(n)
#define THEME_VALUE(n) ThemeProvider::themeValue(n)
#define THEME_VALUE_COLOR(n) THEME_VALUE(n).name()
#include <QJsonObject>
#include <QTableView>
#include <QColor>
#include <QIcon>
#include <rdapi/config.h>
class ThemeProvider
{
public:
ThemeProvider() = delete;
ThemeProvider(const ThemeProvider&) = delete;
public:
static QStringList uiThemes();
static QStringList themes();
static QString uiTheme(const QString& name);
static QString theme(const QString& name);
static bool isDarkTheme();
static QColor themeValue(rd_type theme);
static QIcon icon(const QString& name);
static void applyTheme();
private:
static void applyListingTheme();
static bool loadTheme(const QString &theme);
static QStringList readThemes(const QString& path);
private:
static QJsonObject m_theme;
};