diff options
author | crupest <crupest@outlook.com> | 2022-02-17 18:32:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-17 18:32:52 +0800 |
commit | ada641977cd57a50fc862243ba256c58efc065b8 (patch) | |
tree | 0f2124b88496f42e2cce2e3aaa64211131c18b37 /src/theme_builder/components/conditions/CompoundConditionEditor.cpp | |
parent | 9b3b13f78fffefb18f64aad88891d36009a8052e (diff) | |
download | cru-ada641977cd57a50fc862243ba256c58efc065b8.tar.gz cru-ada641977cd57a50fc862243ba256c58efc065b8.tar.bz2 cru-ada641977cd57a50fc862243ba256c58efc065b8.zip |
...
Diffstat (limited to 'src/theme_builder/components/conditions/CompoundConditionEditor.cpp')
-rw-r--r-- | src/theme_builder/components/conditions/CompoundConditionEditor.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/theme_builder/components/conditions/CompoundConditionEditor.cpp b/src/theme_builder/components/conditions/CompoundConditionEditor.cpp index ae72b51f..b7f54f77 100644 --- a/src/theme_builder/components/conditions/CompoundConditionEditor.cpp +++ b/src/theme_builder/components/conditions/CompoundConditionEditor.cpp @@ -59,17 +59,18 @@ CompoundConditionEditor::CompoundConditionEditor() { break; } if (editor) { + ConnectChangeEvent(editor.get()); auto child = std::make_unique<CompoundConditionEditorChild>(std::move(editor)); child->RemoveEvent()->AddSpyOnlyHandler([this, c = child.get()] { auto index = this->children_container_.IndexOf(c->GetRootControl()); this->children_.erase(this->children_.begin() + index); this->children_container_.RemoveChildAt(index); - change_event_.Raise(nullptr); + RaiseChangeEvent(); }); children_.push_back(std::move(child)); children_container_.AddChild(children_.back()->GetRootControl()); - change_event_.Raise(nullptr); + RaiseChangeEvent(); } }); } @@ -92,19 +93,20 @@ void CompoundConditionEditor::SetChildren( children_.clear(); for (const auto& condition : children) { auto condition_editor = CreateConditionEditor(condition.get()); + ConnectChangeEvent(condition_editor.get()); auto child = std::make_unique<CompoundConditionEditorChild>( std::move(condition_editor)); child->RemoveEvent()->AddSpyOnlyHandler([this, c = child.get()] { auto index = this->children_container_.IndexOf(c->GetRootControl()); this->children_.erase(this->children_.begin() + index); this->children_container_.RemoveChildAt(index); - change_event_.Raise(nullptr); + RaiseChangeEvent(); }); children_.push_back(std::move(child)); children_container_.AddChild(children_.back()->GetRootControl()); } if (trigger_change) { - change_event_.Raise(nullptr); + RaiseChangeEvent(); } } } // namespace cru::theme_builder::components::conditions |