aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/conditions/CompoundConditonEditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/theme_builder/components/conditions/CompoundConditonEditor.cpp')
-rw-r--r--src/theme_builder/components/conditions/CompoundConditonEditor.cpp17
1 files changed, 16 insertions, 1 deletions
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<ConditionEditor>&& 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() {}