Commit f3a23813 authored by Tobias Hunger's avatar Tobias Hunger

CMake: Use eliding label instead of manually eliding text

This fixes the kit options page becoming wider in some cases as the
eliding was apparently off.

Change-Id: Ia682b75a2441d8d265b7c5a3c9943e36f33167db
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent 6bf0c3b6
......@@ -35,6 +35,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/algorithm.h>
#include <utils/elidinglabel.h>
#include <utils/qtcassert.h>
#include <QBoxLayout>
......@@ -278,7 +279,7 @@ QString CMakeGeneratorKitConfigWidget::toolTip() const
CMakeConfigurationKitConfigWidget::CMakeConfigurationKitConfigWidget(Kit *kit,
const KitInformation *ki) :
KitConfigWidget(kit, ki),
m_summaryLabel(new QLabel),
m_summaryLabel(new Utils::ElidingLabel),
m_manageButton(new QPushButton)
{
refresh();
......@@ -303,13 +304,9 @@ void CMakeConfigurationKitConfigWidget::refresh()
{
const QStringList current = CMakeConfigurationKitInformation::toStringList(kit());
QString shortSummary = current.join(QLatin1String("; "));
QFontMetrics fm(m_summaryLabel->font());
shortSummary = fm.elidedText(shortSummary, Qt::ElideRight, m_summaryLabel->width());
m_summaryLabel->setText(current.isEmpty() ? tr("<No Changes to Apply>") : shortSummary);
m_summaryLabel->setText(current.join("; "));
if (m_editor)
m_editor->setPlainText(current.join(QLatin1Char('\n')));
m_editor->setPlainText(current.join('\n'));
}
QWidget *CMakeConfigurationKitConfigWidget::mainWidget() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment