diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-18 00:46:27 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-18 00:46:27 +0800 |
| commit | 6b4edc9be8ec556147c195cf2047d92b9439efd7 (patch) | |
| tree | a1d7b7d1e821b4e1911fd00761f77a24ee483f4a /src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp | |
| parent | f7c4d19df66c602d74795e98ce2ee4390d06fbb4 (diff) | |
| download | cru-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/stylers/CompoundStylerEditor.cpp')
| -rw-r--r-- | src/ThemeBuilder/components/stylers/CompoundStylerEditor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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(); |
