Improve behavior of cpp editor tool bar

The parse context drop down was taking a content based, fixed amount of
space in the editor tool bar, without being shrinkable.

That was especially bad if you have a long project / target name. When
working with a small window / split, the outline drop down would be
dropped from the tool bar.

This patch makes the parse context drop down shrinkable (with a small
minimum size), and gives the outline drop down a slightly higher
priority for getting tool bar space.

Task-number: QTCREATORBUG-19386
Change-Id: I87e3ee2e411a43b1f398ffd24fe5608e4df02af6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Eike Ziller
2018-04-19 15:18:39 +02:00
parent 7421e59a77
commit 2dff9a03ac
3 changed files with 19 additions and 0 deletions

View File

@@ -112,6 +112,7 @@ CppEditorOutline::CppEditorOutline(TextEditor::TextEditorWidget *editorWidget)
m_combo->setMinimumContentsLength(22);
QSizePolicy policy = m_combo->sizePolicy();
policy.setHorizontalPolicy(QSizePolicy::Expanding);
policy.setHorizontalStretch(2);
m_combo->setSizePolicy(policy);
m_combo->setMaxVisibleItems(40);