From b4c4702e944d7e61c0b0be3360c7aff1a22f58e1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 13 Jun 2017 10:32:28 +0200 Subject: [PATCH] feat(ui/modules/Linphone/Chat/FileMessage): provide a download icon --- linphone-desktop/assets/images/download.svg | 16 ++++++++++++++ linphone-desktop/resources.qrc | 1 + .../ui/modules/Linphone/Chat/FileMessage.qml | 21 +++++++++++++++---- .../Linphone/Styles/Chat/ChatStyle.qml | 19 +++++++++++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 linphone-desktop/assets/images/download.svg diff --git a/linphone-desktop/assets/images/download.svg b/linphone-desktop/assets/images/download.svg new file mode 100644 index 000000000..c1328fc73 --- /dev/null +++ b/linphone-desktop/assets/images/download.svg @@ -0,0 +1,16 @@ + + + + dowanload_icon + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/linphone-desktop/resources.qrc b/linphone-desktop/resources.qrc index 74e1cde0d..3aebe92d4 100644 --- a/linphone-desktop/resources.qrc +++ b/linphone-desktop/resources.qrc @@ -82,6 +82,7 @@ assets/images/delete_hovered.svg assets/images/delete_normal.svg assets/images/delete_pressed.svg + assets/images/download.svg assets/images/drop_down.svg assets/images/edit_hovered.svg assets/images/edit_normal.svg diff --git a/linphone-desktop/ui/modules/Linphone/Chat/FileMessage.qml b/linphone-desktop/ui/modules/Linphone/Chat/FileMessage.qml index d91fd5924..f02eb1765 100644 --- a/linphone-desktop/ui/modules/Linphone/Chat/FileMessage.qml +++ b/linphone-desktop/ui/modules/Linphone/Chat/FileMessage.qml @@ -89,12 +89,12 @@ Row { id: extension Rectangle { - color: Colors.l50 + color: ChatStyle.entry.message.file.extension.background.color Text { anchors.fill: parent - color: Colors.k + color: ChatStyle.entry.message.file.extension.text.color font.bold: true elide: Text.ElideRight text: Utils.getExtension($chatEntry.fileName).toUpperCase() @@ -152,13 +152,13 @@ Row { visible: $chatEntry.status === ChatModel.MessageStatusInProgress background: Rectangle { - color: Colors.f + color: ChatStyle.entry.message.file.status.bar.background.color radius: ChatStyle.entry.message.file.status.bar.radius } contentItem: Item { Rectangle { - color: Colors.z + color: ChatStyle.entry.message.file.status.bar.contentItem.color height: parent.height width: progressBar.visualPosition * parent.width } @@ -179,6 +179,19 @@ Row { } } + Icon { + anchors { + bottom: parent.bottom + bottomMargin: ChatStyle.entry.message.file.margins + right: parent.right + rightMargin: ChatStyle.entry.message.file.margins + } + + icon: 'download' + iconSize: ChatStyle.entry.message.file.iconSize + visible: !$chatEntry.isOutgoing + } + MouseArea { anchors.fill: parent cursorShape: containsMouse diff --git a/linphone-desktop/ui/modules/Linphone/Styles/Chat/ChatStyle.qml b/linphone-desktop/ui/modules/Linphone/Styles/Chat/ChatStyle.qml index 0ed21ca6b..a63bf7bcd 100644 --- a/linphone-desktop/ui/modules/Linphone/Styles/Chat/ChatStyle.qml +++ b/linphone-desktop/ui/modules/Linphone/Styles/Chat/ChatStyle.qml @@ -61,6 +61,7 @@ QtObject { property QtObject file: QtObject { property int height: 64 + property int iconSize: 18 property int margins: 8 property int spacing: 8 property int width: 250 @@ -71,6 +72,24 @@ QtObject { property QtObject bar: QtObject { property int height: 6 property int radius: 3 + + property QtObject background: QtObject { + property color color: Colors.f + } + + property QtObject contentItem: QtObject { + property color color: Colors.z + } + } + } + + property QtObject extension: QtObject { + property QtObject background: QtObject { + property color color: Colors.l50 + } + + property QtObject text: QtObject { + property color color: Colors.k } }