looper/theme.h

40 lines
963 B
C
Raw Normal View History

2023-07-09 18:56:12 -07:00
#pragma once
#include "config.h"
2023-07-09 18:56:12 -07:00
#include "imgui.h"
#include <set>
2023-07-24 23:13:47 -07:00
#include <map>
2023-07-09 18:56:12 -07:00
#include <string>
#include "file_browser.h"
2023-07-24 23:13:47 -07:00
#include <json/json.h>
2023-07-09 18:56:12 -07:00
#include <filesystem>
using std::string;
using namespace std::filesystem;
2023-07-24 23:13:47 -07:00
struct ThemeStrings {
string name;
string description;
ThemeStrings();
};
2023-07-09 18:56:12 -07:00
class Theme {
ImGuiStyle style;
public:
static std::set<path> availableThemes;
static void updateAvailableThemes();
static path themeDir;
2023-07-09 18:56:12 -07:00
static const char* prefPath;
2023-07-24 23:13:47 -07:00
static const int MinSchemaVersion = 0;
static const int MaxSchemaVersion = 1;
2023-07-09 18:56:12 -07:00
string file_path;
2023-07-24 23:13:47 -07:00
std::map<string, ThemeStrings> strings;
2023-07-09 18:56:12 -07:00
std::set<int> HueEnabledColors;
static bool ShowEditor(bool *open, Theme* &theme, ImGuiID dockid, int window_width, int window_height);
2023-07-09 18:56:12 -07:00
void Apply(float hue);
void Save(string path);
void Save(path path);
2023-07-09 18:56:12 -07:00
Theme();
Theme(bool dark);
Theme(string path);
Theme(path path);
2023-07-09 18:56:12 -07:00
};