2021-04-22 19:18:19 +02:00
|
|
|
#pragma once
|
|
|
|
#include <map>
|
|
|
|
#include <mutex>
|
|
|
|
#include <imgui.h>
|
|
|
|
#include <vector>
|
2021-04-22 23:49:35 +02:00
|
|
|
#include <json.hpp>
|
|
|
|
|
|
|
|
using nlohmann::json;
|
2021-04-22 19:18:19 +02:00
|
|
|
|
|
|
|
struct Theme {
|
|
|
|
std::string author;
|
2021-04-22 23:49:35 +02:00
|
|
|
json data;
|
2021-04-22 19:18:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class ThemeManager {
|
|
|
|
public:
|
|
|
|
bool loadThemesFromDir(std::string path);
|
|
|
|
bool loadTheme(std::string path);
|
|
|
|
bool applyTheme(std::string name);
|
|
|
|
|
|
|
|
std::vector<std::string> getThemeNames();
|
|
|
|
|
2021-06-23 21:45:38 +02:00
|
|
|
ImVec4 waterfallBg = ImVec4(0.0f, 0.0f, 0.0f, 1.0f);;
|
|
|
|
ImVec4 clearColor = ImVec4(0.0666f, 0.0666f, 0.0666f, 1.0f);
|
|
|
|
|
2021-04-22 19:18:19 +02:00
|
|
|
private:
|
|
|
|
static bool decodeRGBA(std::string str, uint8_t out[4]);
|
|
|
|
|
2021-04-22 23:49:35 +02:00
|
|
|
static std::map<std::string, int> IMGUI_COL_IDS;
|
|
|
|
|
2021-04-22 19:18:19 +02:00
|
|
|
std::map<std::string, Theme> themes;
|
|
|
|
|
|
|
|
};
|