From 3484ad6a39732567f6600f87bc280f565598a3a2 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 12 May 2017 17:46:59 +0200 Subject: [PATCH] Added message delivery notification --- .../assets/images/chat_delivered.svg | 15 +++++ linphone-desktop/assets/images/chat_error.svg | 14 ++-- linphone-desktop/assets/images/chat_read.svg | 15 +++++ linphone-desktop/assets/languages/en.ts | 15 +++++ linphone-desktop/assets/languages/fr.ts | 15 +++++ linphone-desktop/resources.qrc | 2 + .../ui/modules/Common/Constants/Colors.qml | 2 + .../modules/Linphone/Chat/OutgoingMessage.qml | 65 +++++++++++++------ .../Linphone/Styles/Chat/ChatStyle.qml | 3 +- 9 files changed, 119 insertions(+), 27 deletions(-) create mode 100644 linphone-desktop/assets/images/chat_delivered.svg create mode 100644 linphone-desktop/assets/images/chat_read.svg diff --git a/linphone-desktop/assets/images/chat_delivered.svg b/linphone-desktop/assets/images/chat_delivered.svg new file mode 100644 index 000000000..31a7e684b --- /dev/null +++ b/linphone-desktop/assets/images/chat_delivered.svg @@ -0,0 +1,15 @@ + + + + chat_delivered + Created with Sketch. + + + + + + + + + + diff --git a/linphone-desktop/assets/images/chat_error.svg b/linphone-desktop/assets/images/chat_error.svg index 1a9838722..dae82f344 100644 --- a/linphone-desktop/assets/images/chat_error.svg +++ b/linphone-desktop/assets/images/chat_error.svg @@ -1,14 +1,18 @@ - - + + chat_error Created with Sketch. - - - + + + + + + + \ No newline at end of file diff --git a/linphone-desktop/assets/images/chat_read.svg b/linphone-desktop/assets/images/chat_read.svg new file mode 100644 index 000000000..a5164e407 --- /dev/null +++ b/linphone-desktop/assets/images/chat_read.svg @@ -0,0 +1,15 @@ + + + + chat_read + Created with Sketch. + + + + + + + + + + diff --git a/linphone-desktop/assets/languages/en.ts b/linphone-desktop/assets/languages/en.ts index 4b2a6ab18..895a4ff22 100644 --- a/linphone-desktop/assets/languages/en.ts +++ b/linphone-desktop/assets/languages/en.ts @@ -809,6 +809,21 @@ your friend's SIP address or username. Select you active account + + OutgoingMessage + + Error + Error + + + Read + Read + + + Delivered + Delivered + + Presence diff --git a/linphone-desktop/assets/languages/fr.ts b/linphone-desktop/assets/languages/fr.ts index 61ca489a7..659be65c2 100644 --- a/linphone-desktop/assets/languages/fr.ts +++ b/linphone-desktop/assets/languages/fr.ts @@ -808,6 +808,21 @@ un chat ou ajouter un contact. Sélectionner votre compte principal + + OutgoingMessage + + Error + Erreur + + + Read + Lu + + + Delivered + Délivré + + Presence diff --git a/linphone-desktop/resources.qrc b/linphone-desktop/resources.qrc index adfc8035d..e0e472481 100644 --- a/linphone-desktop/resources.qrc +++ b/linphone-desktop/resources.qrc @@ -48,10 +48,12 @@ assets/images/camera_on_updating.svg assets/images/chat_amount.svg assets/images/chat_count.svg + assets/images/chat_delivered.svg assets/images/chat_error.svg assets/images/chat_hovered.svg assets/images/chat_normal.svg assets/images/chat_pressed.svg + assets/images/chat_read.svg assets/images/chat_send.svg assets/images/collapse.svg assets/images/contact_add_hovered.svg diff --git a/linphone-desktop/ui/modules/Common/Constants/Colors.qml b/linphone-desktop/ui/modules/Common/Constants/Colors.qml index 529c20a42..d4084a958 100644 --- a/linphone-desktop/ui/modules/Common/Constants/Colors.qml +++ b/linphone-desktop/ui/modules/Common/Constants/Colors.qml @@ -40,4 +40,6 @@ QtObject { property color z: '#17A81A' property color error: '#FF0000' + property color read: '#18A7AF' + property color delivered: '#A7A7A7' } diff --git a/linphone-desktop/ui/modules/Linphone/Chat/OutgoingMessage.qml b/linphone-desktop/ui/modules/Linphone/Chat/OutgoingMessage.qml index d6d5eafaa..e35047cd8 100644 --- a/linphone-desktop/ui/modules/Linphone/Chat/OutgoingMessage.qml +++ b/linphone-desktop/ui/modules/Linphone/Chat/OutgoingMessage.qml @@ -32,20 +32,52 @@ Item { Component { id: icon - Icon { - property bool isNotDelivered: Utils.includes([ - ChatModel.MessageStatusFileTransferError, - ChatModel.MessageStatusIdle, - ChatModel.MessageStatusInProgress, - ChatModel.MessageStatusNotDelivered - ], $chatEntry.status) + RowLayout { + Text { + property bool isNotDelivered: Utils.includes([ + ChatModel.MessageStatusFileTransferError, + ChatModel.MessageStatusIdle, + ChatModel.MessageStatusInProgress, + ChatModel.MessageStatusNotDelivered + ], $chatEntry.status) - icon: isNotDelivered ? 'chat_error' : 'chat_send' - iconSize: ChatStyle.entry.message.outgoing.sendIconSize + property bool isRead: Utils.includes([ + ChatModel.MessageStatusDisplayed + ], $chatEntry.status) - MouseArea { - anchors.fill: parent - onClicked: isNotDelivered && proxyModel.resendMessage(index) + text: isNotDelivered ? qsTr("Error") : isRead ? qsTr("Read") : qsTr("Delivered") + color: isNotDelivered ? Colors.error : isRead ? Colors.read : Colors.delivered + font.pointSize: ChatStyle.entry.message.outgoing.fontSize + } + + 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' + iconSize: ChatStyle.entry.message.outgoing.sendIconSize + + MouseArea { + anchors.fill: parent + onClicked: isNotDelivered && proxyModel.resendMessage(index) + } + } + + ActionButton { + height: ChatStyle.entry.lineHeight + icon: 'delete' + iconSize: ChatStyle.entry.deleteIconSize + visible: isHoverEntry() + + onClicked: removeEntry() } } } @@ -63,15 +95,6 @@ Item { ? indicator : icon } - - ActionButton { - height: ChatStyle.entry.lineHeight - icon: 'delete' - iconSize: ChatStyle.entry.deleteIconSize - visible: isHoverEntry() - - onClicked: removeEntry() - } } } } diff --git a/linphone-desktop/ui/modules/Linphone/Styles/Chat/ChatStyle.qml b/linphone-desktop/ui/modules/Linphone/Styles/Chat/ChatStyle.qml index 26cdbc253..b2f1aac74 100644 --- a/linphone-desktop/ui/modules/Linphone/Styles/Chat/ChatStyle.qml +++ b/linphone-desktop/ui/modules/Linphone/Styles/Chat/ChatStyle.qml @@ -96,7 +96,8 @@ QtObject { property QtObject outgoing: QtObject { property color backgroundColor: Colors.e - property int sendIconSize: 12 + property int sendIconSize: 10 + property int fontSize: 8 property QtObject text: QtObject { property color color: Colors.r