Commit 514ec10c authored by Lasse Holmstedt's avatar Lasse Holmstedt
Browse files

QML Observer: Print correct id in crumble path and elide text

parent 3e919302
......@@ -179,12 +179,15 @@ QString AbstractFormEditorTool::titleForItem(QGraphicsItem *item)
if (!objectStringId.isEmpty()) {
constructedName = objectStringId + " (" + className + ")";
} else {
if (!gfxObject->objectName().isEmpty())
if (!gfxObject->objectName().isEmpty()) {
constructedName = gfxObject->objectName() + " (" + className + ")";
} else {
constructedName = className;
}
}
}
return className;
return constructedName;
}
......
......@@ -126,7 +126,10 @@ void CrumblePathButton::paintEvent(QPaintEvent *)
}
}
p.setPen(StyleHelper::panelTextColor());
p.drawText(QRectF(m_textPos.x(), 4, geom.width(), geom.height()), text());
QFontMetrics fm(p.font());
QString textToDraw = fm.elidedText(text(), Qt::ElideRight, geom.width() - m_textPos.x());
p.drawText(QRectF(m_textPos.x(), 4, geom.width(), geom.height()), textToDraw);
}
void CrumblePathButton::tintImages()
......
Supports Markdown
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