fix size of splits not loading properly (#2554)
This commit is contained in:
@@ -412,6 +412,11 @@ Split *SplitContainer::getTopRightSplit(Node &node)
|
||||
|
||||
void SplitContainer::layout()
|
||||
{
|
||||
if (this->disableLayouting_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// update top right split
|
||||
auto topRight = this->getTopRightSplit(this->baseNode_);
|
||||
if (this->topRight_)
|
||||
@@ -702,7 +707,10 @@ void SplitContainer::applyFromDescriptor(const NodeDescriptor &rootNode)
|
||||
{
|
||||
assert(this->baseNode_.type_ == Node::EmptyRoot);
|
||||
|
||||
this->disableLayouting_ = true;
|
||||
this->applyFromDescriptorRecursively(rootNode, &this->baseNode_);
|
||||
this->disableLayouting_ = false;
|
||||
this->layout();
|
||||
}
|
||||
|
||||
void SplitContainer::applyFromDescriptorRecursively(
|
||||
@@ -769,6 +777,13 @@ void SplitContainer::applyFromDescriptorRecursively(
|
||||
{
|
||||
Node *_node = new Node();
|
||||
_node->parent_ = node;
|
||||
|
||||
if (auto *n = std::get_if<ContainerNodeDescriptor>(&item))
|
||||
{
|
||||
_node->flexH_ = n->flexH_;
|
||||
_node->flexV_ = n->flexV_;
|
||||
}
|
||||
|
||||
node->children_.emplace_back(_node);
|
||||
this->applyFromDescriptorRecursively(item, _node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user