forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.4'
Conflicts: qtcreator.pri src/libs/qmljs/qmljstypedescriptionreader.cpp src/plugins/analyzerbase/startremotedialog.ui src/plugins/qmldesigner/designercore/include/rewriterview.h src/plugins/qt4projectmanager/makestep.cpp Change-Id: If9d15a8c8f73106585fd8ce6ac47c253a40af6b1
This commit is contained in:
@@ -78,15 +78,16 @@ public:
|
||||
virtual void goToPrev() = 0;
|
||||
|
||||
public slots:
|
||||
void popup() { popup(true); }
|
||||
void popup(bool withFocus) { emit showPage(withFocus); }
|
||||
void popup() { popup(true, false); }
|
||||
void popup(bool withFocus) { popup(withFocus, false); }
|
||||
void popup(bool withFocus, bool ensureSizeHint) { emit showPage(withFocus, ensureSizeHint); }
|
||||
void hide() { emit hidePage(); }
|
||||
void toggle() { toggle(true); }
|
||||
void toggle(bool withFocusIfShown) { emit togglePage(withFocusIfShown); }
|
||||
void navigateStateChanged() { emit navigateStateUpdate(); }
|
||||
|
||||
signals:
|
||||
void showPage(bool withFocus);
|
||||
void showPage(bool withFocus, bool ensureSizeHint);
|
||||
void hidePage();
|
||||
void togglePage(bool withFocusIfShown);
|
||||
void navigateStateUpdate();
|
||||
|
||||
@@ -143,6 +143,28 @@ bool OutputPanePlaceHolder::isMaximized() const
|
||||
return Internal::OutputPaneManager::instance()->isMaximized();
|
||||
}
|
||||
|
||||
void OutputPanePlaceHolder::ensureSizeHintAsMinimum()
|
||||
{
|
||||
if (!d->m_splitter)
|
||||
return;
|
||||
int idx = d->m_splitter->indexOf(this);
|
||||
if (idx < 0)
|
||||
return;
|
||||
|
||||
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);
|
||||
if (difference <= 0) // is already larger
|
||||
return;
|
||||
for (int i = 0; i < sizes.count(); ++i) {
|
||||
sizes[i] += difference / (sizes.count()-1);
|
||||
}
|
||||
sizes[idx] = minimum;
|
||||
d->m_splitter->setSizes(sizes);
|
||||
}
|
||||
|
||||
void OutputPanePlaceHolder::unmaximize()
|
||||
{
|
||||
if (Internal::OutputPaneManager::instance()->isMaximized())
|
||||
|
||||
@@ -64,6 +64,7 @@ public:
|
||||
|
||||
void unmaximize();
|
||||
bool isMaximized() const;
|
||||
void ensureSizeHintAsMinimum();
|
||||
|
||||
private slots:
|
||||
void currentModeChanged(Core::IMode *);
|
||||
|
||||
@@ -254,7 +254,7 @@ void OutputPaneManager::init()
|
||||
const int idx = m_outputWidgetPane->addWidget(outPane->outputWidget(this));
|
||||
|
||||
m_pageMap.insert(idx, outPane);
|
||||
connect(outPane, SIGNAL(showPage(bool)), this, SLOT(showPage(bool)));
|
||||
connect(outPane, SIGNAL(showPage(bool,bool)), this, SLOT(showPage(bool,bool)));
|
||||
connect(outPane, SIGNAL(hidePage()), this, SLOT(slotHide()));
|
||||
connect(outPane, SIGNAL(togglePage(bool)), this, SLOT(togglePage(bool)));
|
||||
connect(outPane, SIGNAL(navigateStateUpdate()), this, SLOT(updateNavigateState()));
|
||||
@@ -431,10 +431,12 @@ void OutputPaneManager::updateNavigateState()
|
||||
}
|
||||
|
||||
// Slot connected to showPage signal of each page
|
||||
void OutputPaneManager::showPage(bool focus)
|
||||
void OutputPaneManager::showPage(bool focus, bool ensureSizeHint)
|
||||
{
|
||||
int idx = findIndexForPage(qobject_cast<IOutputPane*>(sender()));
|
||||
showPage(idx, focus);
|
||||
if (ensureSizeHint && OutputPanePlaceHolder::getCurrent())
|
||||
OutputPanePlaceHolder::getCurrent()->ensureSizeHintAsMinimum();
|
||||
}
|
||||
|
||||
void OutputPaneManager::showPage(int idx, bool focus)
|
||||
|
||||
@@ -78,7 +78,7 @@ protected:
|
||||
|
||||
private slots:
|
||||
void changePage();
|
||||
void showPage(bool focus);
|
||||
void showPage(bool focus, bool ensureSizeHint);
|
||||
void togglePage(bool focus);
|
||||
void clearPage();
|
||||
void buttonTriggered();
|
||||
|
||||
Reference in New Issue
Block a user