Spectral/qml/component/StateBubble.qml

26 lines
666 B
QML
Raw Normal View History

2018-07-12 01:44:41 +00:00
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
2018-07-10 04:18:21 +00:00
Rectangle {
readonly property bool isEmote: eventType === "emote"
id: stateRect
width: Math.min(stateText.implicitWidth + 24, messageListView.width)
height: stateText.implicitHeight + 24
color: isEmote ? Material.accent : "lightgrey"
Label {
id: stateText
text: "<b>" + author.displayName + "</b> " + display
color: isEmote ? "white" : "black"
2018-07-12 01:44:41 +00:00
linkColor: isEmote ? "white" : Material.accent
2018-07-10 04:18:21 +00:00
anchors.fill: parent
anchors.margins: 12
wrapMode: Label.Wrap
textFormat: Text.StyledText
}
}