From 2803ddcca73860256153a2a45b760d2f51ecdabd Mon Sep 17 00:00:00 2001 From: chenzhe Date: Fri, 20 Dec 2019 10:22:08 +0800 Subject: [PATCH] feat(dde-dock): add 2d three point for bug 6378 --- frame/item/components/appsnapshot.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frame/item/components/appsnapshot.cpp b/frame/item/components/appsnapshot.cpp index 472950c00..99fdd1fec 100644 --- a/frame/item/components/appsnapshot.cpp +++ b/frame/item/components/appsnapshot.cpp @@ -113,8 +113,9 @@ void AppSnapshot::compositeChanged() const void AppSnapshot::setWindowInfo(const WindowInfo &info) { m_windowInfo = info; - - m_title->setText(m_windowInfo.title); + QFontMetrics fm(m_title->font()); + QString strTtile = m_title->fontMetrics().elidedText(m_windowInfo.title, Qt::ElideRight, width()); + m_title->setText(strTtile); } void AppSnapshot::dragEnterEvent(QDragEnterEvent *e)