From bc35583099ee728b3d7babb7016c66a4246dafb5 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 20 Feb 2019 17:35:03 +0100 Subject: [PATCH] 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 --- src/plugins/debugger/debuggermainwindow.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index c177b3ffcaa..641b6a7f058 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -119,6 +119,7 @@ public: void resetCurrentPerspective(); int indexInChooser(Perspective *perspective) const; void fixupLayoutIfNeeded(); + void updatePerspectiveChooserWidth(); DebuggerMainWindow *q = nullptr; Perspective *m_currentPerspective = nullptr; @@ -416,10 +417,17 @@ void DebuggerMainWindowPrivate::selectPerspective(Perspective *perspective) fixupLayoutIfNeeded(); } + updatePerspectiveChooserWidth(); +} + +void DebuggerMainWindowPrivate::updatePerspectiveChooserWidth() +{ + Perspective *perspective = m_currentPerspective; int index = indexInChooser(m_currentPerspective); if (index == -1) { - if (Perspective *parent = Perspective::findPerspective(m_currentPerspective->d->m_parentPerspectiveId)) - index = indexInChooser(parent); + perspective = Perspective::findPerspective(m_currentPerspective->d->m_parentPerspectiveId); + if (perspective) + index = indexInChooser(perspective); } if (index != -1) {