From c2efc8f65b0a1543e15193f2e06cb43bc57ee5d3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 13 Oct 2016 14:48:04 +0200 Subject: [PATCH] feat(Calls): StartingOutgoingCall in progress --- tests/imgs/chat.svg | 16 ++- tests/imgs/micro.svg | 15 +++ tests/imgs/speaker.svg | 15 +++ tests/resources.qrc | 2 + .../modules/Linphone/Popup/DropDownMenu.qml | 7 +- tests/ui/views/Calls/Calls.qml | 2 +- tests/ui/views/Calls/StartingCall.qml | 91 ++++++++++++++- tests/ui/views/Calls/StartingIncomingCall.qml | 107 +++--------------- tests/ui/views/Calls/StartingOutgoingCall.qml | 46 +++++++- 9 files changed, 195 insertions(+), 106 deletions(-) create mode 100644 tests/imgs/micro.svg create mode 100644 tests/imgs/speaker.svg diff --git a/tests/imgs/chat.svg b/tests/imgs/chat.svg index 851ec6a94..10fc72b3f 100644 --- a/tests/imgs/chat.svg +++ b/tests/imgs/chat.svg @@ -1,17 +1,15 @@ - + - chat_add + footer_chat Created with Sketch. - - - - - - + + + + - \ No newline at end of file + diff --git a/tests/imgs/micro.svg b/tests/imgs/micro.svg new file mode 100644 index 000000000..e079cd5f4 --- /dev/null +++ b/tests/imgs/micro.svg @@ -0,0 +1,15 @@ + + + + micro_default + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/tests/imgs/speaker.svg b/tests/imgs/speaker.svg new file mode 100644 index 000000000..4b298fcc9 --- /dev/null +++ b/tests/imgs/speaker.svg @@ -0,0 +1,15 @@ + + + + speaker_default + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/tests/resources.qrc b/tests/resources.qrc index 97933875e..1a5ebe4fa 100644 --- a/tests/resources.qrc +++ b/tests/resources.qrc @@ -22,7 +22,9 @@ imgs/linphone.png imgs/lost_incoming_call.svg imgs/lost_outgoing_call.svg + imgs/micro.svg imgs/right_arrow.svg + imgs/speaker.svg imgs/valid.svg languages/en.qm languages/fr.qm diff --git a/tests/ui/modules/Linphone/Popup/DropDownMenu.qml b/tests/ui/modules/Linphone/Popup/DropDownMenu.qml index 2cb5732e2..5e4922301 100644 --- a/tests/ui/modules/Linphone/Popup/DropDownMenu.qml +++ b/tests/ui/modules/Linphone/Popup/DropDownMenu.qml @@ -35,7 +35,10 @@ Rectangle { anchors.fill: parent color: PopupStyle.backgroundColor - layer.enabled: true - layer.effect: PopupShadow { } + + layer { + enabled: true + effect: PopupShadow { } + } } } diff --git a/tests/ui/views/Calls/Calls.qml b/tests/ui/views/Calls/Calls.qml index 5b9ce9e9f..05964de82 100644 --- a/tests/ui/views/Calls/Calls.qml +++ b/tests/ui/views/Calls/Calls.qml @@ -38,7 +38,7 @@ Window { resizeAInPriority: true // Call. - childA: StartingIncomingCall { + childA: StartingOutgoingCall { anchors.fill: parent } diff --git a/tests/ui/views/Calls/StartingCall.qml b/tests/ui/views/Calls/StartingCall.qml index ec287955b..eaa85e8d8 100644 --- a/tests/ui/views/Calls/StartingCall.qml +++ b/tests/ui/views/Calls/StartingCall.qml @@ -1,7 +1,96 @@ import QtQuick 2.7 +import QtQuick.Layouts 1.3 -Item { +import Linphone 1.0 +Rectangle { + default property alias actionArea: actionArea.data + property alias callType: callType.text + property alias sipAddress: contactDescription.sipAddress + property alias username: contactDescription.username + property alias avatarImage: image.source + color: '#EAEAEA' + ColumnLayout { + anchors { + fill: parent + margins: 20 + } + + spacing: 0 + + // Call type. + Column { + Layout.fillWidth: true + + Text { + id: callType + + color: '#8E8E8E' + font.bold: true + font.pointSize: 17 + horizontalAlignment: Text.AlignHCenter + width: parent.width + } + + Text { + color: '#8E8E8E' + font.bold: true + font.pointSize: 17 + horizontalAlignment: Text.AlignHCenter + text: '...' + width: parent.width + } + } + + // Contact area. + Item { + id: contactContainer + + Layout.fillWidth: true + Layout.fillHeight: true + + Item { + anchors.verticalCenter: parent.verticalCenter + implicitHeight: contactDescription.height + image.height + width: parent.width + + ContactDescription { + id: contactDescription + + height: 60 + horizontalTextAlignment: Text.AlignHCenter + width: parent.width + } + + RoundedImage { + id: image + + function _computeImageSize () { + var height = contactContainer.height - contactDescription.height + var width = contactContainer.width + + var size = height < 400 ? height : 400 + return size < width ? size : width + } + + anchors.top: contactDescription.bottom + anchors.horizontalCenter: parent.horizontalCenter + height: _computeImageSize() + width: height + } + } + } + + // Actions area. + Item { + id: actionArea + + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + Layout.preferredHeight: 80 + Layout.topMargin: 20 + } + } } diff --git a/tests/ui/views/Calls/StartingIncomingCall.qml b/tests/ui/views/Calls/StartingIncomingCall.qml index dff15469f..1a3b5a28b 100644 --- a/tests/ui/views/Calls/StartingIncomingCall.qml +++ b/tests/ui/views/Calls/StartingIncomingCall.qml @@ -1,102 +1,25 @@ -import QtQuick 2.7 -import QtQuick.Layouts 1.3 - import Linphone 1.0 -Rectangle { - color: '#EAEAEA' +StartingCall { + avatarImage: "qrc:/imgs/cat_contact.jpg" + callType: 'INCOMING CALL' + sipAddress: 'mister-meow@sip-linphone.org' + username: 'Mister Meow' - ColumnLayout { - anchors { - fill: parent - margins: 20 + ActionBar { + anchors.centerIn: parent + iconSize: 40 + + ActionButton { + icon: 'cam' } - spacing: 0 - - // Call type. - Column { - Layout.fillWidth: true - - Text { - color: '#8E8E8E' - font.bold: true - font.pointSize: 17 - horizontalAlignment: Text.AlignHCenter - text: 'INCOMING CALL' - width: parent.width - } - - Text { - color: '#8E8E8E' - font.bold: true - font.pointSize: 17 - horizontalAlignment: Text.AlignHCenter - text: '...' - width: parent.width - } + ActionButton { + icon: 'call' } - // Contact area. - Item { - id: contactContainer - - Layout.fillWidth: true - Layout.fillHeight: true - - Item { - anchors.verticalCenter: parent.verticalCenter - implicitHeight: contactDescription.height + image.height - width: parent.width - - ContactDescription { - id: contactDescription - - height: 60 - horizontalTextAlignment: Text.AlignHCenter - sipAddress: 'mister-meow@sip-linphone.org' - username: 'Mister Meow' - width: parent.width - } - - RoundedImage { - id: image - - function _computeImageSize () { - var height = contactContainer.height - contactDescription.height - var width = contactContainer.width - - var size = height < 400 ? height : 400 - return size < width ? size : width - } - - anchors.top: contactDescription.bottom - anchors.horizontalCenter: parent.horizontalCenter - height: _computeImageSize() - source: "qrc:/imgs/cat_contact.jpg" - width: height - } - } - } - - // Actions area. - ActionBar { - Layout.alignment: Qt.AlignHCenter - Layout.bottomMargin: 20 - Layout.topMargin: 20 - iconSize: 40 - - ActionButton { - icon: 'cam' - } - - ActionButton { - icon: 'call' - } - - ActionButton { - icon: 'hangup' - } + ActionButton { + icon: 'hangup' } } } diff --git a/tests/ui/views/Calls/StartingOutgoingCall.qml b/tests/ui/views/Calls/StartingOutgoingCall.qml index eeb3b2f9b..1d1454873 100644 --- a/tests/ui/views/Calls/StartingOutgoingCall.qml +++ b/tests/ui/views/Calls/StartingOutgoingCall.qml @@ -1,6 +1,50 @@ import QtQuick 2.7 +import QtQuick.Layouts 1.3 -Item { +import Linphone 1.0 +StartingCall { + avatarImage: "qrc:/imgs/cat_contact.jpg" + callType: 'OUTGOING CALL' + sipAddress: 'mister-meow@sip-linphone.org' + username: 'Mister Meow' + RowLayout { + anchors.fill: parent + spacing: 0 + + ActionBar { + iconSize: 40 + + ActionButton { + icon: 'micro' + } + + ActionButton { + icon: 'speaker' + } + + ActionButton { + icon: 'cam' + } + } + + // TODO: Cam. + Item { + Layout.fillWidth: true + Layout.fillHeight: true + } + + ActionBar { + iconSize: 40 + + ActionButton { + icon: 'hangup' + } + + ActionButton { + icon: 'chat' + } + } + } }