summaryrefslogtreecommitdiff
path: root/src/ui/include/themes.hpp
blob: 11680c0dd1d9d1cda05c1755b4daacb673337b8d (plain)
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
#pragma once

#include "lvgl.h"

namespace ui {
namespace themes {

enum class Style {
  kMenuItem,
  kMenuSubheadFirst,
  kMenuSubhead,
  kTopBar,
  kPopup,
  kTab,
  kButtonPrimary,
};

class Theme {
 public:
  void Apply(void);
  void Callback(lv_obj_t* obj);
  void ApplyStyle(lv_obj_t* obj, Style style);

  static auto instance() -> Theme*;

 private:
  Theme();

  lv_style_t base_style_;
  lv_style_t base_focused_style_;

  lv_style_t button_style_;
  lv_style_t bar_style_;
  lv_style_t dropdown_style_;
  lv_style_t dropdown_list_style_;

  lv_style_t slider_indicator_style_;
  lv_style_t slider_knob_style_;
  lv_style_t slider_knob_focused_style_;

  lv_style_t switch_style_;
  lv_style_t switch_indicator_style_;
  lv_style_t switch_indicator_checked_style_;
  lv_style_t switch_knob_style_;

  lv_theme_t theme_;
};
}  // namespace themes
}  // namespace ui