aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/conditions/CompoundConditonEditor.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-15 16:02:55 +0800
committercrupest <crupest@outlook.com>2022-02-15 16:02:55 +0800
commit85f4cb239f10e1801e43f0874a4f637def5daaee (patch)
tree3587ebc63b9ecd6d0df745740f6ac94dd06e9460 /src/theme_builder/components/conditions/CompoundConditonEditor.cpp
parentb40bae96224fb6fb80e96d2072d0f104f2ef2f59 (diff)
downloadcru-85f4cb239f10e1801e43f0874a4f637def5daaee.tar.gz
cru-85f4cb239f10e1801e43f0874a4f637def5daaee.tar.bz2
cru-85f4cb239f10e1801e43f0874a4f637def5daaee.zip
...
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() {}