From 23aa037670a16fd62e0e33e6ff0575b043419760 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 13 Sep 2016 12:20:24 +0200 Subject: [PATCH] fix(Avatar): supports presence --- tests/languages/en.ts | 38 +++++++++---------- tests/languages/fr.ts | 38 +++++++++---------- tests/resources.qrc | 2 +- tests/ui/components/contact/Avatar.qml | 22 ++++++++++- .../{searchContact.qml => contacts.qml} | 0 tests/ui/views/mainWindow/mainWindow.qml | 2 +- 6 files changed, 61 insertions(+), 41 deletions(-) rename tests/ui/views/mainWindow/{searchContact.qml => contacts.qml} (100%) diff --git a/tests/languages/en.ts b/tests/languages/en.ts index 1a69fee4b..812ce7efb 100644 --- a/tests/languages/en.ts +++ b/tests/languages/en.ts @@ -8,6 +8,25 @@ Search contact or enter SIP address + + contacts + + searchContactPlaceholder + Search contact + + + selectAllContacts + All + + + selectConnectedContacts + Connected + + + addContact + ADD CONTACT + + home @@ -112,23 +131,4 @@ CANCEL - - searchContact - - searchContactPlaceholder - Search contact - - - selectAllContacts - All - - - selectConnectedContacts - Connected - - - addContact - ADD CONTACT - - diff --git a/tests/languages/fr.ts b/tests/languages/fr.ts index 48f232e9b..accede66b 100644 --- a/tests/languages/fr.ts +++ b/tests/languages/fr.ts @@ -8,6 +8,25 @@ Rechercher un contact ou entrer une adresse SIP + + contacts + + searchContactPlaceholder + Rechercher contact + + + selectAllContacts + Tous + + + selectConnectedContacts + Connectés + + + addContact + AJOUTER CONTACT + + home @@ -112,23 +131,4 @@ ANNULER - - searchContact - - searchContactPlaceholder - Rechercher contact - - - selectAllContacts - Tous - - - selectConnectedContacts - Connectés - - - addContact - AJOUTER CONTACT - - diff --git a/tests/resources.qrc b/tests/resources.qrc index e0d5fa590..c2c780248 100644 --- a/tests/resources.qrc +++ b/tests/resources.qrc @@ -22,9 +22,9 @@ ui/components/select/SelectContact.qml + ui/views/mainWindow/contacts.qml ui/views/mainWindow/home.qml ui/views/mainWindow/mainWindow.qml - ui/views/mainWindow/searchContact.qml ui/views/manageAccounts.qml ui/views/newCall.qml diff --git a/tests/ui/components/contact/Avatar.qml b/tests/ui/components/contact/Avatar.qml index 44be3fff5..a24c8a7ae 100644 --- a/tests/ui/components/contact/Avatar.qml +++ b/tests/ui/components/contact/Avatar.qml @@ -4,8 +4,9 @@ import QtGraphicalEffects 1.0 // =================================================================== Item { - property string username property alias image: imageToFilter.source + property string presence + property string username Rectangle { anchors.fill: parent @@ -14,6 +15,7 @@ Item { radius: 20 } + // Initials. Text { anchors.centerIn: parent color: '#FFFFFF' @@ -39,9 +41,27 @@ Item { visible: false } + // Avatar. OpacityMask { anchors.fill: imageToFilter source: imageToFilter maskSource: avatar } + + // Presence. + Image { + anchors.bottom: parent.bottom + anchors.right: parent.right + fillMode: Image.PreserveAspectFit + height: parent.height/ 3 + id: presenceImage + source: (function () { + if (!presence) { + return '' + } + + return 'qrc:/imgs/led_' + presence + '.svg' + })() + width: parent.width / 3 + } } diff --git a/tests/ui/views/mainWindow/searchContact.qml b/tests/ui/views/mainWindow/contacts.qml similarity index 100% rename from tests/ui/views/mainWindow/searchContact.qml rename to tests/ui/views/mainWindow/contacts.qml diff --git a/tests/ui/views/mainWindow/mainWindow.qml b/tests/ui/views/mainWindow/mainWindow.qml index c82acca78..68ec738a8 100644 --- a/tests/ui/views/mainWindow/mainWindow.qml +++ b/tests/ui/views/mainWindow/mainWindow.qml @@ -142,7 +142,7 @@ ApplicationWindow { Loader { Layout.fillHeight: true Layout.fillWidth: true - source: 'qrc:/ui/views/mainWindow/searchContact.qml' + source: 'qrc:/ui/views/mainWindow/contacts.qml' } } }