diff options
Diffstat (limited to 'src/theme_builder/components/HeadBodyEditor.cpp')
-rw-r--r-- | src/theme_builder/components/HeadBodyEditor.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/theme_builder/components/HeadBodyEditor.cpp b/src/theme_builder/components/HeadBodyEditor.cpp new file mode 100644 index 00000000..6d7ace66 --- /dev/null +++ b/src/theme_builder/components/HeadBodyEditor.cpp @@ -0,0 +1,30 @@ +#include "HeadBodyEditor.h" +#include "Common.h" +#include "cru/ui/ThemeManager.h" +#include "cru/ui/controls/FlexLayout.h" + +namespace cru::theme_builder::components { +HeadBodyEditor::HeadBodyEditor() { + border_.SetChild(&container_); + border_.SetBackgroundBrush(CreateRandomEditorBackgroundBrush()); + + container_.SetFlexDirection(ui::controls::FlexDirection::Vertical); + container_.AddChild(&head_container_); + container_.SetItemCrossAlign(ui::controls::FlexCrossAlignment::Stretch); + head_container_.SetFlexDirection(ui::controls::FlexDirection::Horizontal); + head_container_.AddChild(&label_); + + remove_button_.GetStyleRuleSet()->SetParent( + ui::ThemeManager::GetInstance()->GetResourceStyleRuleSet( + u"cru.theme_builder.icon-button.style")); + remove_button_.SetIconWithSvgPathDataStringResourceKey(u"icon.close", + {0, 0, 16, 16}); + remove_button_.SetIconFillColor(ui::colors::red); + head_container_.AddChild(&remove_button_); + + remove_button_.ClickEvent()->AddSpyOnlyHandler( + [this] { remove_event_.Raise(nullptr); }); +} + +HeadBodyEditor::~HeadBodyEditor() {} +} // namespace cru::theme_builder::components |