diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 6b05293e366..7dafb93e0cf 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -134,6 +134,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) : connect(d->m_goForwardAction, SIGNAL(triggered()), this, SIGNAL(goForwardClicked())); d->m_editorList->setProperty("hideicon", true); + d->m_editorList->setProperty("notelideasterisk", true); d->m_editorList->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); d->m_editorList->setMinimumContentsLength(20); d->m_editorList->setModel(d->m_editorsListModel); diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 3b0163217a0..330f6576d31 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -718,7 +718,20 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt editRect.adjust(0, 0, -13, 0); } - QString text = option->fontMetrics.elidedText(cb->currentText, Qt::ElideRight, editRect.width()); + QLatin1Char asterisk('*'); + int elideWidth = editRect.width(); + + bool notElideAsterisk = widget && widget->property("notelideasterisk").toBool() + && cb->currentText.endsWith(asterisk) + && option->fontMetrics.width(cb->currentText) > elideWidth; + + QString text; + if (notElideAsterisk) { + elideWidth -= option->fontMetrics.width(asterisk); + text = asterisk; + } + text.prepend(option->fontMetrics.elidedText(cb->currentText, Qt::ElideRight, elideWidth)); + if ((option->state & State_Enabled)) { painter->setPen(QColor(0, 0, 0, 70)); painter->drawText(editRect.adjusted(1, 0, -1, 0), Qt::AlignLeft | Qt::AlignVCenter, text);