aboutsummaryrefslogtreecommitdiff
path: root/src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-11-18 00:46:27 +0800
committerYuqian Yang <crupest@crupest.life>2025-11-18 00:46:27 +0800
commit6b4edc9be8ec556147c195cf2047d92b9439efd7 (patch)
treea1d7b7d1e821b4e1911fd00761f77a24ee483f4a /src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp
parentf7c4d19df66c602d74795e98ce2ee4390d06fbb4 (diff)
downloadcru-6b4edc9be8ec556147c195cf2047d92b9439efd7.tar.gz
cru-6b4edc9be8ec556147c195cf2047d92b9439efd7.tar.bz2
cru-6b4edc9be8ec556147c195cf2047d92b9439efd7.zip
Bring back ControlHost and refactor tree management of control.
Diffstat (limited to 'src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp')
-rw-r--r--src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp b/src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp
index b9b1fdef..d7324350 100644
--- a/src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp
+++ b/src/ThemeBuilder/components/conditions/CompoundConditionEditor.cpp
@@ -63,7 +63,8 @@ CompoundConditionEditor::CompoundConditionEditor() {
if (editor) {
ConnectChangeEvent(editor.get());
editor->RemoveEvent()->AddSpyOnlyHandler([this, c = editor.get()] {
- auto index = this->children_container_.IndexOf(c->GetRootControl());
+ auto index =
+ this->children_container_.IndexOfChild(c->GetRootControl());
this->children_.erase(this->children_.begin() + index);
this->children_container_.RemoveChildAt(index);
RaiseChangeEvent();
@@ -88,13 +89,13 @@ CompoundConditionEditor::GetChildren() {
void CompoundConditionEditor::SetChildren(
std::vector<ClonePtr<ui::style::Condition>> children, bool trigger_change) {
- children_container_.ClearChildren();
+ children_container_.RemoveAllChild();
children_.clear();
for (const auto& condition : children) {
auto editor = CreateConditionEditor(condition.get());
ConnectChangeEvent(editor.get());
editor->RemoveEvent()->AddSpyOnlyHandler([this, c = editor.get()] {
- auto index = this->children_container_.IndexOf(c->GetRootControl());
+ auto index = this->children_container_.IndexOfChild(c->GetRootControl());
this->children_.erase(this->children_.begin() + index);
this->children_container_.RemoveChildAt(index);
RaiseChangeEvent();