You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
642 B
39 lines
642 B
2 years ago
|
#pragma once
|
||
|
|
||
1 year ago
|
#include <string>
|
||
|
#include <map>
|
||
|
#include <vector>
|
||
2 years ago
|
#include "lvgl.h"
|
||
|
|
||
|
namespace ui {
|
||
|
namespace themes {
|
||
2 years ago
|
|
||
2 years ago
|
enum class Style {
|
||
|
kMenuItem,
|
||
|
kMenuSubheadFirst,
|
||
|
kMenuSubhead,
|
||
|
kTopBar,
|
||
|
kPopup,
|
||
|
kTab,
|
||
|
kButtonPrimary,
|
||
|
};
|
||
|
|
||
2 years ago
|
class Theme {
|
||
|
public:
|
||
|
void Apply(void);
|
||
|
void Callback(lv_obj_t* obj);
|
||
1 year ago
|
void ApplyStyle(lv_obj_t* obj, std::string style_key);
|
||
2 years ago
|
|
||
1 year ago
|
void AddStyle(std::string key, int selector, lv_style_t* style);
|
||
|
|
||
2 years ago
|
static auto instance() -> Theme*;
|
||
2 years ago
|
|
||
|
private:
|
||
2 years ago
|
Theme();
|
||
1 year ago
|
std::map<std::string, std::vector<std::pair<int, lv_style_t*>>> style_map;
|
||
2 years ago
|
lv_theme_t theme_;
|
||
1 year ago
|
|
||
2 years ago
|
};
|
||
|
} // namespace themes
|
||
1 year ago
|
} // namespace ui
|