Commit 1374d853 authored by Thomas Surrel's avatar Thomas Surrel Committed by Kurt Hindenburg
Browse files

Do not alter other split sizes when adding a new one

This fixes the following behavior:
- Add an horizontal split and resize it
- Now add a vertical split
=> the horizontal split gets resized
parent f5074294
......@@ -108,6 +108,7 @@ void ViewSplitter::addTerminalDisplay(TerminalDisplay *terminalDisplay, Qt::Orie
} else if (containerOrientation == splitter->orientation()) {
splitter->insertWidget(currentIndex, terminalDisplay);
} else {
QList<int> sizes = splitter->sizes();
auto newSplitter = new ViewSplitter();
TerminalDisplay *oldTerminalDisplay = splitter->activeTerminalDisplay();
const int oldContainerIndex = splitter->indexOf(oldTerminalDisplay);
......@@ -115,12 +116,12 @@ void ViewSplitter::addTerminalDisplay(TerminalDisplay *terminalDisplay, Qt::Orie
newSplitter->addWidget(behavior == AddBehavior::AddBefore ? terminalDisplay : oldTerminalDisplay);
newSplitter->addWidget(behavior == AddBehavior::AddBefore ? oldTerminalDisplay : terminalDisplay);
newSplitter->setOrientation(containerOrientation);
newSplitter->updateSizes();
newSplitter->show();
splitter->insertWidget(oldContainerIndex, newSplitter);
splitter->m_blockPropagatedDeletion = false;
splitter->setSizes(sizes);
newSplitter->updateSizes();
}
splitter->updateSizes();
}
void ViewSplitter::childEvent(QChildEvent *event)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment