Show tooltip about defined user material in the label placeholder list.

This commit is contained in:
Roman Telezhynskyi 2021-10-02 19:15:08 +03:00
parent b6dc3f30b8
commit bcb786958e
2 changed files with 9 additions and 2 deletions

View File

@ -11,6 +11,7 @@
- Fix incorrect comparison of the global length of passmark to minimal allowed value.
- Make an increment name valid after user selected it from a completion list.
- [smart-pattern/valentina#150] Fix Seam allowance not correct at intersection curve and axis.
- Show tooltip about defined user material in the label placeholder list.
# Valentina 0.7.49 July 1, 2021
- Fix crash.

View File

@ -571,19 +571,25 @@ void DialogEditLabel::InitPlaceholders()
VAbstractValApplication::VApp()->GetMeasurementsType() == MeasurementsType::Multisize
? QStringLiteral("vst") : QStringLiteral("vit")));
const QString materialDescription = tr("User material");
const QString userMaterialStr = tr("User material");
const QMap<int, QString> materials = m_doc->GetPatternMaterials();
for (int i = 0; i < userMaterialPlaceholdersQuantity; ++i)
{
const QString number = QString::number(i+1);
QString materialDescription;
QString value;
if (materials.contains(i + 1))
{
value = materials.value(i + 1);
materialDescription = QStringLiteral("%1 %2 <%3>").arg(userMaterialStr, number, value);
}
else
{
materialDescription = QStringLiteral("%1 %2").arg(userMaterialStr, number);
}
m_placeholders.insert(pl_userMaterial + number, qMakePair(materialDescription + number, value));
m_placeholders.insert(pl_userMaterial + number, qMakePair(materialDescription, value));
}
{