Skip to content

Commit

Permalink
Fixed ticket:6165 use the max width available
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Oct 22, 2020
1 parent ac7c569 commit 00a0b9b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions OMEdit/OMEditLIB/Element/ElementProperties.cpp
Expand Up @@ -192,9 +192,11 @@ void Parameter::setValueWidget(QString value, bool defaultValue, QString fromUni
mpValueComboBox->blockSignals(state);
}
if (adjustSize) {
/* Set the minimum width so that the value text will be readable */
/* Set the minimum width so that the value text will be readable.
* If the items width is greater than the value text than use it.
*/
fm = QFontMetrics(mpValueComboBox->lineEdit()->font());
mpValueComboBox->setMinimumWidth(fm.width(value) + 50);
mpValueComboBox->setMinimumWidth(qMax(fm.width(value), mpValueComboBox->minimumSizeHint().width()) + 50);
}
break;
case Parameter::CheckBox:
Expand Down

0 comments on commit 00a0b9b

Please sign in to comment.