matrixion/resources/qml/ElidedLabel.qml

29 lines
658 B
QML
Raw Normal View History

2021-05-19 20:34:10 +03:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick 2.9
2021-06-13 02:48:11 +03:00
import QtQuick.Controls 2.5
2021-05-19 20:34:10 +03:00
import im.nheko 1.0
Label {
id: root
property alias fullText: metrics.text
property alias elideWidth: metrics.elideWidth
color: Nheko.colors.text
2021-05-22 11:16:42 +03:00
text: (textFormat == Text.PlainText) ? metrics.elidedText : TimelineManager.escapeEmoji(TimelineManager.htmlEscape(metrics.elidedText))
2021-05-19 20:34:10 +03:00
maximumLineCount: 1
elide: Text.ElideRight
textFormat: Text.PlainText
TextMetrics {
id: metrics
font.pointSize: root.font.pointSize
elide: Text.ElideRight
}
}