Commit ad7dfd28 authored by L. E. Segovia's avatar L. E. Segovia

Elide ExprControl labels

parent c38cf7a9
......@@ -153,7 +153,12 @@ ExprControl::ExprControl(int id, Editable* editable, bool showColorLink)
// see parser's specRegisterEditable
// TODO these labels are untranslatable
QString editableLabel = QString::fromStdString(editable->name);
_label = new QLabel(QString(tr("<b>%1</b>")).arg(editableLabel));
_label = new QLabel();
QFontMetrics _labelSize(_label->font());
// Fix label appearance and word wrap, just in case -- amyspark
// 45px gives us some breathing space
_label->setFixedWidth(60);
_label->setText(tr("<b>%1</b>").arg(_labelSize.elidedText(editableLabel, Qt::TextElideMode::ElideRight, 45)));
_label->setAutoFillBackground(true);
hbox->addWidget(_label);
......
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