forked from qt-creator/qt-creator
Debugger: Fix resizing of main perspective switcher combo
In case of debugger sub-perspectives this was effectively operating on the names of the subperspective, not the "Debugger" string. Change-Id: Ia5c3ea564b2b1a3ed3291d3cb6bae18e1fb5533f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -119,6 +119,7 @@ public:
|
|||||||
void resetCurrentPerspective();
|
void resetCurrentPerspective();
|
||||||
int indexInChooser(Perspective *perspective) const;
|
int indexInChooser(Perspective *perspective) const;
|
||||||
void fixupLayoutIfNeeded();
|
void fixupLayoutIfNeeded();
|
||||||
|
void updatePerspectiveChooserWidth();
|
||||||
|
|
||||||
DebuggerMainWindow *q = nullptr;
|
DebuggerMainWindow *q = nullptr;
|
||||||
Perspective *m_currentPerspective = nullptr;
|
Perspective *m_currentPerspective = nullptr;
|
||||||
@@ -416,10 +417,17 @@ void DebuggerMainWindowPrivate::selectPerspective(Perspective *perspective)
|
|||||||
fixupLayoutIfNeeded();
|
fixupLayoutIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updatePerspectiveChooserWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebuggerMainWindowPrivate::updatePerspectiveChooserWidth()
|
||||||
|
{
|
||||||
|
Perspective *perspective = m_currentPerspective;
|
||||||
int index = indexInChooser(m_currentPerspective);
|
int index = indexInChooser(m_currentPerspective);
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
if (Perspective *parent = Perspective::findPerspective(m_currentPerspective->d->m_parentPerspectiveId))
|
perspective = Perspective::findPerspective(m_currentPerspective->d->m_parentPerspectiveId);
|
||||||
index = indexInChooser(parent);
|
if (perspective)
|
||||||
|
index = indexInChooser(perspective);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user