diff options
| author | crupest <crupest@outlook.com> | 2022-03-29 22:55:29 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2022-03-29 22:55:29 +0800 |
| commit | 77e217af8bdbfb20b9147f6159d5bdfda439ea95 (patch) | |
| tree | 46873c9dc28ad7d0f900a8f7610a1ea4b881f75e /src/theme_builder/components/HeadBodyEditor.h | |
| parent | 6c09f49d51a564ff4dd0a6d3fa9804dffc2b236c (diff) | |
| download | cru-77e217af8bdbfb20b9147f6159d5bdfda439ea95.tar.gz cru-77e217af8bdbfb20b9147f6159d5bdfda439ea95.tar.bz2 cru-77e217af8bdbfb20b9147f6159d5bdfda439ea95.zip | |
...
Diffstat (limited to 'src/theme_builder/components/HeadBodyEditor.h')
| -rw-r--r-- | src/theme_builder/components/HeadBodyEditor.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/theme_builder/components/HeadBodyEditor.h b/src/theme_builder/components/HeadBodyEditor.h new file mode 100644 index 00000000..8119724f --- /dev/null +++ b/src/theme_builder/components/HeadBodyEditor.h @@ -0,0 +1,36 @@ +#pragma once +#include "Editor.h" +#include "cru/common/Event.h" +#include "cru/ui/controls/Container.h" +#include "cru/ui/controls/FlexLayout.h" +#include "cru/ui/controls/IconButton.h" +#include "cru/ui/controls/TextBlock.h" +#include "cru/ui/style/Styler.h" + +namespace cru::theme_builder::components { +class HeadBodyEditor : public Editor { + public: + HeadBodyEditor(); + ~HeadBodyEditor() override; + + public: + ui::controls::Control* GetRootControl() override { return &border_; } + + ui::controls::FlexLayout* GetContainer() { return &container_; } + ui::controls::FlexLayout* GetHeadContainer() { return &head_container_; } + + String GetLabel() const { return label_.GetText(); } + void SetLabel(String label) { label_.SetText(std::move(label)); } + + IEvent<std::nullptr_t>* RemoveEvent() { return &remove_event_; } + + private: + ui::controls::Container border_; + ui::controls::FlexLayout container_; + ui::controls::FlexLayout head_container_; + ui::controls::TextBlock label_; + ui::controls::IconButton remove_button_; + + Event<std::nullptr_t> remove_event_; +}; +} // namespace cru::theme_builder::components |
