mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Improve styling of emote messages
This commit is contained in:
parent
c5af3543e6
commit
284fc8eaa8
3 changed files with 10 additions and 11 deletions
|
@ -32,7 +32,10 @@ Item {
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
roleValue: MtxEvent.EmoteMessage
|
roleValue: MtxEvent.EmoteMessage
|
||||||
TextMessage {}
|
NoticeMessage {
|
||||||
|
formatted: chat.model.escapeEmoji(modelData.userName) + " " + model.data.formattedBody
|
||||||
|
color: chat.model.userColor(modelData.userId, colors.window)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
roleValue: MtxEvent.ImageMessage
|
roleValue: MtxEvent.ImageMessage
|
||||||
|
@ -69,19 +72,19 @@ Item {
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
roleValue: MtxEvent.Name
|
roleValue: MtxEvent.Name
|
||||||
NoticeMessage {
|
NoticeMessage {
|
||||||
notice: model.data.roomName ? qsTr("room name changed to: %1").arg(model.data.roomName) : qsTr("removed room name")
|
text: model.data.roomName ? qsTr("room name changed to: %1").arg(model.data.roomName) : qsTr("removed room name")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
roleValue: MtxEvent.Topic
|
roleValue: MtxEvent.Topic
|
||||||
NoticeMessage {
|
NoticeMessage {
|
||||||
notice: model.data.roomTopic ? qsTr("topic changed to: %1").arg(model.data.roomTopic) : qsTr("removed topic")
|
text: model.data.roomTopic ? qsTr("topic changed to: %1").arg(model.data.roomTopic) : qsTr("removed topic")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
roleValue: MtxEvent.Member
|
roleValue: MtxEvent.Member
|
||||||
NoticeMessage {
|
NoticeMessage {
|
||||||
notice: timelineManager.timeline.formatMemberEvent(model.data.id);
|
text: timelineManager.timeline.formatMemberEvent(model.data.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
import ".."
|
TextMessage {
|
||||||
|
|
||||||
MatrixText {
|
|
||||||
property string notice: model.data.formattedBody.replace("<pre>", "<pre style='white-space: pre-wrap'>")
|
|
||||||
text: notice
|
|
||||||
width: parent ? parent.width : undefined
|
|
||||||
font.italic: true
|
font.italic: true
|
||||||
color: inactiveColors.text
|
color: inactiveColors.text
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import ".."
|
import ".."
|
||||||
|
|
||||||
MatrixText {
|
MatrixText {
|
||||||
text: model.data.formattedBody.replace("<pre>", "<pre style='white-space: pre-wrap'>")
|
property string formatted: model.data.formattedBody
|
||||||
|
text: formatted.replace("<pre>", "<pre style='white-space: pre-wrap'>")
|
||||||
width: parent ? parent.width : undefined
|
width: parent ? parent.width : undefined
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue