Spectral/qml/component/StateBubble.qml

27 lines
742 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
2018-07-20 04:14:02 +00:00
color: isEmote ? Material.accent : background
2018-07-10 04:18:21 +00:00
Label {
id: stateText
text: "<b>" + author.displayName + "</b> " + display
2018-07-20 04:14:02 +00:00
color: isEmote ? "white" : Material.foreground
linkColor: isEmote || darkTheme ? "white" : Material.accent
2018-07-10 04:18:21 +00:00
anchors.fill: parent
anchors.margins: 12
wrapMode: Label.Wrap
textFormat: Text.StyledText
2018-07-20 14:36:19 +00:00
onLinkActivated: Qt.openUrlExternally(link)
2018-07-10 04:18:21 +00:00
}
}