From 6b4edc9be8ec556147c195cf2047d92b9439efd7 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Tue, 18 Nov 2025 00:46:27 +0800 Subject: Bring back ControlHost and refactor tree management of control. --- src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp') diff --git a/src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp b/src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp index 1a20bf70..90d19a68 100644 --- a/src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp +++ b/src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp @@ -65,7 +65,8 @@ CompoundStylerEditor::CompoundStylerEditor() { 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(); @@ -94,7 +95,7 @@ void CompoundStylerEditor::SetValue(ui::style::CompoundStyler* value, auto editor = CreateStylerEditor(styler.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(); -- cgit v1.2.3