mirror of https://github.com/Nheko-Reborn/nheko
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.
30 lines
777 B
30 lines
777 B
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
|
// SPDX-FileCopyrightText: 2022 Nheko Contributors
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import QtQuick 2.9
|
|
import QtQuick.Controls 2.5
|
|
import im.nheko
|
|
|
|
Label {
|
|
id: root
|
|
|
|
property alias fullText: metrics.text
|
|
property alias elideWidth: metrics.elideWidth
|
|
property int fullTextWidth: Math.ceil(metrics.advanceWidth)
|
|
|
|
color: timelineRoot.palette.text
|
|
text: (textFormat == Text.PlainText) ? metrics.elidedText : TimelineManager.escapeEmoji(TimelineManager.htmlEscape(metrics.elidedText))
|
|
maximumLineCount: 1
|
|
elide: Text.ElideRight
|
|
textFormat: Text.PlainText
|
|
|
|
TextMetrics {
|
|
id: metrics
|
|
|
|
font.pointSize: root.font.pointSize
|
|
elide: Text.ElideRight
|
|
}
|
|
|
|
}
|
|
|