aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/conditions/CompoundConditonEditor.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-16 19:10:00 +0800
committercrupest <crupest@outlook.com>2022-02-16 19:10:00 +0800
commit6459edc7c8af9e5c9bafe4f1635194334f42f415 (patch)
tree5d11434b5db55a8ab033676e1ed6a32a5bb2f599 /src/theme_builder/components/conditions/CompoundConditonEditor.cpp
parentec2060983edd2b77ff90b2533404d77ea892a5d9 (diff)
downloadcru-6459edc7c8af9e5c9bafe4f1635194334f42f415.tar.gz
cru-6459edc7c8af9e5c9bafe4f1635194334f42f415.tar.bz2
cru-6459edc7c8af9e5c9bafe4f1635194334f42f415.zip
...
Diffstat (limited to 'src/theme_builder/components/conditions/CompoundConditonEditor.cpp')
-rw-r--r--src/theme_builder/components/conditions/CompoundConditonEditor.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/theme_builder/components/conditions/CompoundConditonEditor.cpp b/src/theme_builder/components/conditions/CompoundConditonEditor.cpp
deleted file mode 100644
index 96daa20b..00000000
--- a/src/theme_builder/components/conditions/CompoundConditonEditor.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "CompoundConditionEditor.h"
-#include "cru/common/ClonablePtr.h"
-#include "cru/ui/style/Condition.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"+");
-}
-
-CompoundConditionEditor::~CompoundConditionEditor() {}
-
-std::vector<ClonablePtr<ui::style::Condition>>
-CompoundConditionEditor::GetChildren() {
- std::vector<ClonablePtr<ui::style::Condition>> children;
- for (auto& child : children_) {
- children.push_back(child->GetConditionEditor()->GetCondition());
- }
- return children;
-}
-
-} // namespace cru::theme_builder::components::conditions