diff options
author | Eike Ziller <eike.ziller@nokia.com> | 2012-08-13 13:34:50 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@nokia.com> | 2012-08-15 07:44:48 +0200 |
commit | 0a369e92411ac7b62c10611f37c1a2692c97f376 (patch) | |
tree | 5c86258d4c6f37b3b0aae5b607de09bf812dfdf6 /src/plugins/projectexplorer/targetselector.cpp | |
parent | 81547c1abc28ffc774875fa32aa444b93b5e6bb2 (diff) | |
download | qt-creator-0a369e92411ac7b62c10611f37c1a2692c97f376.tar.gz |
Target selector: Increase space and right-elide target name
Change-Id: Ifbcccda579cf3d41c0518283900121f5919d260e
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Diffstat (limited to 'src/plugins/projectexplorer/targetselector.cpp')
-rw-r--r-- | src/plugins/projectexplorer/targetselector.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/targetselector.cpp b/src/plugins/projectexplorer/targetselector.cpp index 5cc1ef1274..e3b6bc8f3c 100644 --- a/src/plugins/projectexplorer/targetselector.cpp +++ b/src/plugins/projectexplorer/targetselector.cpp @@ -143,7 +143,7 @@ int TargetSelector::targetWidth() const if (width < 0) { QFontMetrics fm = fontMetrics(); width = qMax(fm.width(runButtonString()), fm.width(buildButtonString())); - width = qMax(129, width * 2 + 31); + width = qMax(149, width * 2 + 31); } return width; } @@ -304,8 +304,10 @@ void TargetSelector::paintEvent(QPaintEvent *event) QRect buttonRect(x, 1, targetWidth() , image.height()); Utils::StyleHelper::drawCornerImage(image, &p, buttonRect, 16, 0, 16, 0); - p.drawText(x + (targetWidth()- fm.width(target.name))/2 + 1, 7 + fm.ascent(), - target.name); + const QString nameText = QFontMetrics(font()).elidedText(target.name, Qt::ElideRight, + targetWidth() - 6); + p.drawText(x + (targetWidth()- fm.width(nameText))/2 + 1, 7 + fm.ascent(), + nameText); // // remove button // if (m_currentHoveredTargetIndex == index) { |