matrixion/qml/TypingIndicator.qml

33 lines
964 B
QML
Raw Normal View History

2021-03-05 02:35:15 +03:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
// SPDX-FileCopyrightText: 2022 Nheko Contributors
2021-03-05 02:35:15 +03:00
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.2
import im.nheko
Item {
Layout.fillWidth: true
2022-04-16 03:13:01 +03:00
implicitHeight: Math.max(fontMetrics.height * 1.2, typingDisplay.height)
Rectangle {
id: typingRect
anchors.fill: parent
2022-04-16 03:13:01 +03:00
color: timelineRoot.palette.base
visible: (room && room.typingUsers.length > 0)
z: 3
Label {
id: typingDisplay
2022-04-16 03:13:01 +03:00
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.leftMargin: 10
anchors.right: parent.right
anchors.rightMargin: 10
2022-04-11 05:18:16 +03:00
color: timelineRoot.palette.text
text: room ? room.formatTypingUsers(room.typingUsers, timelineRoot.palette.base) : ""
textFormat: Text.RichText
}
}
}