aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/StyleRuleEditor.h
blob: 181ff0efd16b05d050a14ca0f450266e93ed4754 (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
#pragma once
#include "cru/ui/components/Component.h"
#include "cru/ui/controls/Control.h"
#include "cru/ui/controls/FlexLayout.h"
#include "cru/ui/style/StyleRule.h"

namespace cru::theme_builder {
class StyleRuleEditor : public ui::components::Component {
 public:
  StyleRuleEditor();

  CRU_DELETE_COPY(StyleRuleEditor)
  CRU_DELETE_MOVE(StyleRuleEditor)

  ~StyleRuleEditor() override;

 public:
  ui::controls::Control* GetRootControl() override { return main_layout_; }

  void BindStyleRule(ui::style::StyleRule* rule);

 private:
  void UpdateView();

 private:
  ui::controls::FlexLayout* main_layout_;

  ui::style::StyleRule* style_rule_;
};
}  // namespace cru::theme_builder