diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 85923d697fb..76f10ba15ef 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -119,6 +119,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) : d->m_editorList->setProperty("hideicon", true); d->m_editorList->setProperty("notelideasterisk", true); + d->m_editorList->setProperty("elidemode", Qt::ElideMiddle); d->m_editorList->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); d->m_editorList->setMinimumContentsLength(20); d->m_editorList->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index af050a3e850..43b30b65550 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -886,7 +886,10 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt elideWidth -= option->fontMetrics.horizontalAdvance(asterisk); text = asterisk; } - text.prepend(option->fontMetrics.elidedText(cb->currentText, Qt::ElideRight, elideWidth)); + Qt::TextElideMode elideMode = Qt::ElideRight; + if (widget && widget->dynamicPropertyNames().contains("elidemode")) + elideMode = widget->property("elidemode").value(); + text.prepend(option->fontMetrics.elidedText(cb->currentText, elideMode, elideWidth)); if (creatorTheme()->flag(Theme::ComboBoxDrawTextShadow) && (option->state & State_Enabled))