2023-02-21 23:48:49 +01:00
|
|
|
// SPDX-FileCopyrightText: Nheko Contributors
|
2021-05-19 19:34:10 +02:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.9
|
2021-06-13 01:48:11 +02:00
|
|
|
import QtQuick.Controls 2.5
|
2021-05-19 19:34:10 +02:00
|
|
|
import im.nheko 1.0
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property alias fullText: metrics.text
|
|
|
|
property alias elideWidth: metrics.elideWidth
|
2022-03-20 05:12:41 +01:00
|
|
|
property int fullTextWidth: Math.ceil(metrics.advanceWidth)
|
2021-05-19 19:34:10 +02:00
|
|
|
|
2023-06-02 01:29:05 +02:00
|
|
|
color: palette.text
|
2023-01-07 02:03:04 +01:00
|
|
|
text: (textFormat == Text.PlainText) ? metrics.elidedText : TimelineManager.escapeEmoji(metrics.elidedText)
|
2021-05-19 19:34:10 +02:00
|
|
|
maximumLineCount: 1
|
|
|
|
elide: Text.ElideRight
|
|
|
|
textFormat: Text.PlainText
|
|
|
|
|
|
|
|
TextMetrics {
|
|
|
|
id: metrics
|
|
|
|
|
|
|
|
font.pointSize: root.font.pointSize
|
|
|
|
elide: Text.ElideRight
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|