diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index 782c5ed0295..aee055b9bc1 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -48,12 +48,12 @@ struct OutputPanePlaceHolderPrivate { Core::IMode *m_mode; QSplitter *m_splitter; - bool m_closeable; + int m_lastNonMaxSize; static OutputPanePlaceHolder* m_current; }; OutputPanePlaceHolderPrivate::OutputPanePlaceHolderPrivate(Core::IMode *mode, QSplitter *parent) : - m_mode(mode), m_splitter(parent), m_closeable(true) + m_mode(mode), m_splitter(parent), m_lastNonMaxSize(0) { } @@ -85,16 +85,6 @@ OutputPanePlaceHolder::~OutputPanePlaceHolder() } } -void OutputPanePlaceHolder::setCloseable(bool b) -{ - d->m_closeable = b; -} - -bool OutputPanePlaceHolder::closeable() -{ - return d->m_closeable; -} - void OutputPanePlaceHolder::currentModeChanged(Core::IMode *mode) { if (d->m_current == this) { @@ -110,7 +100,6 @@ void OutputPanePlaceHolder::currentModeChanged(Core::IMode *mode) layout()->addWidget(om); om->show(); om->updateStatusButtons(isVisible()); - om->setCloseable(d->m_closeable); } } @@ -125,6 +114,7 @@ void OutputPanePlaceHolder::maximizeOrMinimize(bool maximize) QList sizes = d->m_splitter->sizes(); if (maximize) { + d->m_lastNonMaxSize = sizes[idx]; int sum = 0; foreach(int s, sizes) sum += s; @@ -133,7 +123,7 @@ void OutputPanePlaceHolder::maximizeOrMinimize(bool maximize) } sizes[idx] = sum - (sizes.count()-1) * 32; } else { - int target = sizeHint().height(); + int target = d->m_lastNonMaxSize > 0 ? d->m_lastNonMaxSize : sizeHint().height(); int space = sizes[idx] - target; if (space > 0) { for (int i = 0; i < sizes.count(); ++i) { diff --git a/src/plugins/coreplugin/outputpane.h b/src/plugins/coreplugin/outputpane.h index 69b7af71af7..1de9343a5a9 100644 --- a/src/plugins/coreplugin/outputpane.h +++ b/src/plugins/coreplugin/outputpane.h @@ -60,8 +60,6 @@ public: explicit OutputPanePlaceHolder(Core::IMode *mode, QSplitter *parent = 0); ~OutputPanePlaceHolder(); - void setCloseable(bool b); - bool closeable(); static OutputPanePlaceHolder *getCurrent(); static bool isCurrentVisible(); diff --git a/src/plugins/coreplugin/outputpanemanager.cpp b/src/plugins/coreplugin/outputpanemanager.cpp index 561e6020dcb..a7e1279166a 100644 --- a/src/plugins/coreplugin/outputpanemanager.cpp +++ b/src/plugins/coreplugin/outputpanemanager.cpp @@ -349,8 +349,7 @@ void OutputPaneManager::buttonTriggered() int idx = it.key(); if (m_widgetComboBox->itemData(m_widgetComboBox->currentIndex()).toInt() == idx && - OutputPanePlaceHolder::isCurrentVisible() - && OutputPanePlaceHolder::getCurrent()->closeable()) { + OutputPanePlaceHolder::isCurrentVisible()) { // we should toggle and the page is already visible and we are actually closeable slotHide(); } else { @@ -464,16 +463,6 @@ void OutputPaneManager::togglePage(bool focus) } } -void OutputPaneManager::setCloseable(bool b) -{ - m_closeButton->setVisible(b); -} - -bool OutputPaneManager::closeable() -{ - return m_closeButton->isVisibleTo(m_closeButton->parentWidget()); -} - void OutputPaneManager::focusInEvent(QFocusEvent *e) { if (m_outputWidgetPane->currentWidget()) diff --git a/src/plugins/coreplugin/outputpanemanager.h b/src/plugins/coreplugin/outputpanemanager.h index f71985d9cb7..921e21dd128 100644 --- a/src/plugins/coreplugin/outputpanemanager.h +++ b/src/plugins/coreplugin/outputpanemanager.h @@ -62,8 +62,6 @@ class OutputPaneManager : public QWidget public: void init(); static OutputPaneManager *instance(); - void setCloseable(bool b); - bool closeable(); QWidget *buttonsWidget(); void updateStatusButtons(bool visible);