aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/stylers/BorderStylerEditor.h
blob: 8e9a4e6f9f38a485f51a1b85c0638cdce0d4f7f8 (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
#pragma once
#include "../properties/ColorPropertyEditor.h"
#include "../properties/CornerRadiusPropertyEditor.h"
#include "../properties/OptionalPropertyEditor.h"
#include "../properties/ThicknessPropertyEditor.h"
#include "cru/common/ClonablePtr.h"
#include "cru/common/Event.h"
#include "cru/ui/components/Component.h"
#include "cru/ui/controls/CheckBox.h"
#include "cru/ui/controls/FlexLayout.h"
#include "cru/ui/style/Styler.h"

namespace cru::theme_builder::components::stylers {
class BorderStylerEditor : public ui::components::Component {
 public:
  BorderStylerEditor();
  ~BorderStylerEditor() override;

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

  ClonablePtr<ui::style::BorderStyler> GetValue();
  void SetValue(const ClonablePtr<ui::style::BorderStyler>& styler);

  IEvent<std::nullptr_t>* ChangeEvent() { return &change_event_; }

 private:
  ui::controls::FlexLayout container_;
  properties::OptionalPropertyEditor<properties::CornerRadiusPropertyEditor>
      corner_radius_editor_;
  properties::OptionalPropertyEditor<properties::ThicknessPropertyEditor>
      thickness_editor_;
  properties::OptionalPropertyEditor<properties::ColorPropertyEditor>
      brush_editor_;
  properties::OptionalPropertyEditor<properties::ColorPropertyEditor>
      foreground_brush_editor_;
  properties::OptionalPropertyEditor<properties::ColorPropertyEditor>
      background_brush_editor_;

  Event<std::nullptr_t> change_event_;
};
}  // namespace cru::theme_builder::components::stylers