diff options
Diffstat (limited to 'src/plugins/coreplugin/outputpane.cpp')
-rw-r--r-- | src/plugins/coreplugin/outputpane.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index e82d1b255a..0002229bf1 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -136,8 +136,10 @@ bool OutputPanePlaceHolder::isMaximized() const return Internal::OutputPaneManager::instance()->isMaximized(); } -void OutputPanePlaceHolder::ensureSizeHintAsMinimum() +void OutputPanePlaceHolder::setDefaultHeight(int height) { + if (height == 0) + return; if (!d->m_splitter) return; int idx = d->m_splitter->indexOf(this); @@ -146,19 +148,24 @@ void OutputPanePlaceHolder::ensureSizeHintAsMinimum() d->m_splitter->refresh(); QList<int> sizes = d->m_splitter->sizes(); - Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance(); - int minimum = (d->m_splitter->orientation() == Qt::Vertical - ? om->sizeHint().height() : om->sizeHint().width()); - int difference = minimum - sizes.at(idx); + int difference = height - sizes.at(idx); if (difference <= 0) // is already larger return; for (int i = 0; i < sizes.count(); ++i) { sizes[i] += difference / (sizes.count()-1); } - sizes[idx] = minimum; + sizes[idx] = height; d->m_splitter->setSizes(sizes); } +void OutputPanePlaceHolder::ensureSizeHintAsMinimum() +{ + Internal::OutputPaneManager *om = Internal::OutputPaneManager::instance(); + int minimum = (d->m_splitter->orientation() == Qt::Vertical + ? om->sizeHint().height() : om->sizeHint().width()); + setDefaultHeight(minimum); +} + void OutputPanePlaceHolder::unmaximize() { if (Internal::OutputPaneManager::instance()->isMaximized()) |