mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 08:41:01 +01:00
[poincare] Fix main layout edition.
If its only child is empty, remove it before adding another child. Change-Id: I3047f17c69ff14787e172d99b6e0b3e1f4096f26
This commit is contained in:
@@ -141,6 +141,10 @@ void ExpressionLayout::addBrother(ExpressionLayoutCursor * cursor, ExpressionLay
|
||||
}
|
||||
// If there is no parent, the pointed layout is the main horizontal layout.
|
||||
// Add the "brother" as a child.
|
||||
// If there is only one empty child, remove it before adding the layout.
|
||||
if (numberOfChildren() == 1 && editableChild(0)->isEmpty()) {
|
||||
removeChildAtIndex(0, true);
|
||||
}
|
||||
if (cursor->position() == ExpressionLayoutCursor::Position::Left) {
|
||||
addChildAtIndex(brother, 0);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user