diff --git a/tests/imgs/cat_contact.jpg b/tests/imgs/cat_contact.jpg new file mode 100644 index 000000000..f3bbdfe30 Binary files /dev/null and b/tests/imgs/cat_contact.jpg differ diff --git a/tests/resources.qrc b/tests/resources.qrc index da5b57228..97933875e 100644 --- a/tests/resources.qrc +++ b/tests/resources.qrc @@ -3,6 +3,7 @@ imgs/add_field.svg imgs/call.svg imgs/cam.svg + imgs/cat_contact.jpg imgs/chat_attachment.svg imgs/chat.svg imgs/collapse.svg @@ -55,6 +56,7 @@ ui/modules/Linphone/Form/TextButtonB.qml ui/modules/Linphone/Form/TransparentComboBox.qml ui/modules/Linphone/Image/Icon.qml + ui/modules/Linphone/Image/RoundedImage.qml ui/modules/Linphone/InvertedMouseArea.qml ui/modules/Linphone/Menu.qml ui/modules/Linphone/Paned.qml @@ -89,6 +91,9 @@ ui/scripts/Utils/qmldir ui/scripts/Utils/utils.js ui/views/Calls/Calls.qml + ui/views/Calls/StartingCall.qml + ui/views/Calls/StartingIncomingCall.qml + ui/views/Calls/StartingOutgoingCall.qml ui/views/MainWindow/Contact.qml ui/views/MainWindow/Contacts.qml ui/views/MainWindow/Conversation.qml diff --git a/tests/scripts/build_resources_file b/tests/scripts/build_resources_file index 9fb86ba82..214078961 100755 --- a/tests/scripts/build_resources_file +++ b/tests/scripts/build_resources_file @@ -12,7 +12,7 @@ do basename="${filename##*/}" extension="${filename##*.}" - if [[ "${extension}" == @(qml|svg|png|qm|js) || + if [[ "${extension}" == @(qml|svg|png|jpg|qm|js) || "${basename}" == "qmldir" ]]; then echo " $filename" >> $RESOURCE_FILE fi diff --git a/tests/ui/modules/Linphone/Contact/ContactDescription.qml b/tests/ui/modules/Linphone/Contact/ContactDescription.qml index 8af3a3d00..35b2129b5 100644 --- a/tests/ui/modules/Linphone/Contact/ContactDescription.qml +++ b/tests/ui/modules/Linphone/Contact/ContactDescription.qml @@ -7,6 +7,7 @@ import Linphone.Styles 1.0 Column { property alias sipAddress: sipAddress.text property alias username: username.text + property int horizontalTextAlignment // Username. Text { @@ -17,6 +18,7 @@ Column { font.bold: true font.pointSize: ContactDescriptionStyle.username.fontSize height: parent.height / 2 + horizontalAlignment: horizontalTextAlignment verticalAlignment: Text.AlignBottom width: parent.width } @@ -29,6 +31,7 @@ Column { color: ContactDescriptionStyle.sipAddress.color font.pointSize: ContactDescriptionStyle.sipAddress.fontSize height: parent.height / 2 + horizontalAlignment: horizontalTextAlignment verticalAlignment: Text.AlignTop width: parent.width } diff --git a/tests/ui/modules/Linphone/Image/RoundedImage.qml b/tests/ui/modules/Linphone/Image/RoundedImage.qml new file mode 100644 index 000000000..a64706295 --- /dev/null +++ b/tests/ui/modules/Linphone/Image/RoundedImage.qml @@ -0,0 +1,47 @@ +import QtQuick 2.7 + +// =================================================================== + +Item { + property alias source: image.source + + Item { + id: imageContainer + + anchors.fill: parent + layer.enabled: true + visible: false + + Image { + id: image + + anchors.fill: parent + fillMode: Image.PreserveAspectCrop + } + } + + Rectangle { + anchors.fill: parent + layer.enabled: true + layer.samplerName: 'mask' + radius: parent.width / 2 + + layer.effect: ShaderEffect { + property var image: imageContainer + + fragmentShader: " + uniform lowp sampler2D image; + uniform lowp sampler2D mask; + uniform lowp float qt_Opacity; + + varying highp vec2 qt_TexCoord0; + + void main () { + gl_FragColor = texture2D(image, qt_TexCoord0) * + texture2D(mask, qt_TexCoord0).a * + qt_Opacity; + } + " + } + } +} diff --git a/tests/ui/modules/Linphone/Styles/Contact/AvatarStyle.qml b/tests/ui/modules/Linphone/Styles/Contact/AvatarStyle.qml index 3d4bf5ad7..865731788 100644 --- a/tests/ui/modules/Linphone/Styles/Contact/AvatarStyle.qml +++ b/tests/ui/modules/Linphone/Styles/Contact/AvatarStyle.qml @@ -13,6 +13,6 @@ QtObject { property QtObject mask: QtObject { property color color: Colors.r - property int radius: 50 + property int radius: 500 } } diff --git a/tests/ui/modules/Linphone/qmldir b/tests/ui/modules/Linphone/qmldir index cbd392cc8..72fa17f55 100644 --- a/tests/ui/modules/Linphone/qmldir +++ b/tests/ui/modules/Linphone/qmldir @@ -51,6 +51,7 @@ TransparentComboBox 1.0 Form/TransparentComboBox.qml # Image Icon 1.0 Image/Icon.qml +RoundedImage 1.0 Image/RoundedImage.qml # InvertedMouseArea InvertedMouseArea 1.0 InvertedMouseArea.qml diff --git a/tests/ui/views/Calls/Calls.qml b/tests/ui/views/Calls/Calls.qml index 46abe9e7e..5b9ce9e9f 100644 --- a/tests/ui/views/Calls/Calls.qml +++ b/tests/ui/views/Calls/Calls.qml @@ -38,13 +38,8 @@ Window { resizeAInPriority: true // Call. - childA: Rectangle { + childA: StartingIncomingCall { anchors.fill: parent - color: 'orange' - - Text { - text: 'hello' - } } // Chat. diff --git a/tests/ui/views/Calls/StartingCall.qml b/tests/ui/views/Calls/StartingCall.qml new file mode 100644 index 000000000..ec287955b --- /dev/null +++ b/tests/ui/views/Calls/StartingCall.qml @@ -0,0 +1,7 @@ +import QtQuick 2.7 + +Item { + + + +} diff --git a/tests/ui/views/Calls/StartingIncomingCall.qml b/tests/ui/views/Calls/StartingIncomingCall.qml new file mode 100644 index 000000000..dff15469f --- /dev/null +++ b/tests/ui/views/Calls/StartingIncomingCall.qml @@ -0,0 +1,102 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.3 + +import Linphone 1.0 + +Rectangle { + color: '#EAEAEA' + + ColumnLayout { + anchors { + fill: parent + margins: 20 + } + + 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 + } + } + + // 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' + } + } + } +} diff --git a/tests/ui/views/Calls/StartingOutgoingCall.qml b/tests/ui/views/Calls/StartingOutgoingCall.qml new file mode 100644 index 000000000..eeb3b2f9b --- /dev/null +++ b/tests/ui/views/Calls/StartingOutgoingCall.qml @@ -0,0 +1,6 @@ +import QtQuick 2.7 + +Item { + + +}