You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nheko/resources/qml/ElidedLabel.qml

29 lines
683 B

// SPDX-FileCopyrightText: Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick 2.9
import QtQuick.Controls 2.5
import im.nheko 1.0
Label {
id: root
property alias elideWidth: metrics.elideWidth
1 year ago
property alias fullText: metrics.text
property int fullTextWidth: Math.ceil(metrics.advanceWidth)
color: palette.text
elide: Text.ElideRight
1 year ago
maximumLineCount: 1
text: (textFormat == Text.PlainText) ? metrics.elidedText : TimelineManager.escapeEmoji(metrics.elidedText)
textFormat: Text.PlainText
TextMetrics {
id: metrics
elide: Text.ElideRight
1 year ago
font.pointSize: root.font.pointSize
}
}