Merge pull request #528 from Murmele/splitterPosition

prevent that diffview will be collapsed
This commit is contained in:
Murmele 2023-04-28 10:09:31 +02:00 committed by GitHub
commit 9da61f630b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -216,6 +216,12 @@ DoubleTreeWidget::DoubleTreeWidget(const git::Repository &repo, QWidget *parent)
splitter->addWidget(treeViewSplitter);
splitter->setStretchFactor(0, 3);
splitter->setStretchFactor(1, 1);
// prevent that diffview will be collapsed
// The problem is that the diffview is between two splitters
// and if the diffview is collapsed only the splitter of the
// commitlist is visible and is is not possible to get the
// diffview visible again.
splitter->setCollapsible(0, false);
connect(splitter, &QSplitter::splitterMoved, this, [splitter] {
QSettings().setValue(kSplitterKey, splitter->saveState());
});