Commit 72a4766c authored by Sylvain Berfini's avatar Sylvain Berfini

Simplified some properties

parent 3484ad6a
...@@ -33,35 +33,24 @@ Item { ...@@ -33,35 +33,24 @@ Item {
id: icon id: icon
RowLayout { RowLayout {
Text { property bool isNotDelivered: Utils.includes([
property bool isNotDelivered: Utils.includes([ ChatModel.MessageStatusFileTransferError,
ChatModel.MessageStatusFileTransferError, ChatModel.MessageStatusIdle,
ChatModel.MessageStatusIdle, ChatModel.MessageStatusInProgress,
ChatModel.MessageStatusInProgress, ChatModel.MessageStatusNotDelivered
ChatModel.MessageStatusNotDelivered ], $chatEntry.status)
], $chatEntry.status)
property bool isRead: Utils.includes([ property bool isRead: Utils.includes([
ChatModel.MessageStatusDisplayed ChatModel.MessageStatusDisplayed
], $chatEntry.status) ], $chatEntry.status)
Text {
text: isNotDelivered ? qsTr("Error") : isRead ? qsTr("Read") : qsTr("Delivered") text: isNotDelivered ? qsTr("Error") : isRead ? qsTr("Read") : qsTr("Delivered")
color: isNotDelivered ? Colors.error : isRead ? Colors.read : Colors.delivered color: isNotDelivered ? Colors.error : isRead ? Colors.read : Colors.delivered
font.pointSize: ChatStyle.entry.message.outgoing.fontSize font.pointSize: ChatStyle.entry.message.outgoing.fontSize
} }
Icon { Icon {
property bool isNotDelivered: Utils.includes([
ChatModel.MessageStatusFileTransferError,
ChatModel.MessageStatusIdle,
ChatModel.MessageStatusInProgress,
ChatModel.MessageStatusNotDelivered
], $chatEntry.status)
property bool isRead: Utils.includes([
ChatModel.MessageStatusDisplayed
], $chatEntry.status)
icon: isNotDelivered ? 'chat_error' : isRead ? 'chat_read' : 'chat_delivered' icon: isNotDelivered ? 'chat_error' : isRead ? 'chat_read' : 'chat_delivered'
iconSize: ChatStyle.entry.message.outgoing.sendIconSize iconSize: ChatStyle.entry.message.outgoing.sendIconSize
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment