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 ...@@ -108,6 +108,7 @@ void ViewSplitter::addTerminalDisplay(TerminalDisplay *terminalDisplay, Qt::Orie
} else if (containerOrientation == splitter->orientation()) { } else if (containerOrientation == splitter->orientation()) {
splitter->insertWidget(currentIndex, terminalDisplay); splitter->insertWidget(currentIndex, terminalDisplay);
} else { } else {
QList<int> sizes = splitter->sizes();
auto newSplitter = new ViewSplitter(); auto newSplitter = new ViewSplitter();
TerminalDisplay *oldTerminalDisplay = splitter->activeTerminalDisplay(); TerminalDisplay *oldTerminalDisplay = splitter->activeTerminalDisplay();
const int oldContainerIndex = splitter->indexOf(oldTerminalDisplay); const int oldContainerIndex = splitter->indexOf(oldTerminalDisplay);
...@@ -115,12 +116,12 @@ void ViewSplitter::addTerminalDisplay(TerminalDisplay *terminalDisplay, Qt::Orie ...@@ -115,12 +116,12 @@ void ViewSplitter::addTerminalDisplay(TerminalDisplay *terminalDisplay, Qt::Orie
newSplitter->addWidget(behavior == AddBehavior::AddBefore ? terminalDisplay : oldTerminalDisplay); newSplitter->addWidget(behavior == AddBehavior::AddBefore ? terminalDisplay : oldTerminalDisplay);
newSplitter->addWidget(behavior == AddBehavior::AddBefore ? oldTerminalDisplay : terminalDisplay); newSplitter->addWidget(behavior == AddBehavior::AddBefore ? oldTerminalDisplay : terminalDisplay);
newSplitter->setOrientation(containerOrientation); newSplitter->setOrientation(containerOrientation);
newSplitter->updateSizes();
newSplitter->show(); newSplitter->show();
splitter->insertWidget(oldContainerIndex, newSplitter); splitter->insertWidget(oldContainerIndex, newSplitter);
splitter->m_blockPropagatedDeletion = false; splitter->m_blockPropagatedDeletion = false;
splitter->setSizes(sizes);
newSplitter->updateSizes();
} }
splitter->updateSizes();
} }
void ViewSplitter::childEvent(QChildEvent *event) void ViewSplitter::childEvent(QChildEvent *event)
......
Supports Markdown
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