From 85f4cb239f10e1801e43f0874a4f637def5daaee Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 15 Feb 2022 16:02:55 +0800 Subject: ... --- .../components/conditions/CompoundConditonEditor.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/theme_builder/components/conditions/CompoundConditonEditor.cpp') diff --git a/src/theme_builder/components/conditions/CompoundConditonEditor.cpp b/src/theme_builder/components/conditions/CompoundConditonEditor.cpp index d3e82878..812c27dc 100644 --- a/src/theme_builder/components/conditions/CompoundConditonEditor.cpp +++ b/src/theme_builder/components/conditions/CompoundConditonEditor.cpp @@ -1,12 +1,27 @@ #include "CompoundConditionEditor.h" namespace cru::theme_builder::components::conditions { +CompoundConditionEditorChild::CompoundConditionEditorChild( + std::unique_ptr&& condition_editor) + : condition_editor_(std::move(condition_editor)) { + container_.SetFlexDirection(ui::controls::FlexDirection::Horizontal); + container_.AddChild(&remove_button_); + + remove_button_.SetChild(&remove_button_text_); + remove_button_text_.SetText(u"-"); + + container_.AddChild(condition_editor_->GetRootControl()); + + remove_button_.ClickEvent()->AddSpyOnlyHandler( + [this] { this->remove_event_.Raise(nullptr); }); +} + CompoundConditionEditor::CompoundConditionEditor() { GetContainer()->AddChild(&children_container_); GetContainer()->AddChild(&add_child_button_); add_child_button_.SetChild(&add_child_button_text_); - add_child_button_text_.SetText(u"Add"); + add_child_button_text_.SetText(u"+"); } CompoundConditionEditor::~CompoundConditionEditor() {} -- cgit v1.2.3