add batch in add_child
This commit is contained in:
parent
360952c25d
commit
3c5c5b6b51
1 changed files with 7 additions and 0 deletions
|
@ -90,6 +90,10 @@ bool Widget::add_child(std::shared_ptr<Widget> child) {
|
|||
if (child->parent()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (window())
|
||||
window()->start_batch();
|
||||
|
||||
m_children.push_back(child);
|
||||
child->set_parent(this);
|
||||
|
||||
|
@ -98,6 +102,9 @@ bool Widget::add_child(std::shared_ptr<Widget> child) {
|
|||
// after we call set_window() on it.
|
||||
child->set_window(m_window);
|
||||
|
||||
if (window())
|
||||
window()->end_batch();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue