diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4b5fab55c..a6e7a44bf 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,7 +12,6 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) -# set(CUSTOM_FLAGS "\ -Wcast-align \ -Wconversion \ @@ -166,6 +165,6 @@ add_executable(${LINPHONE_EXEC} ${SOURCES} ${HEADERS} ${RESOURCES}) add_dependencies(${LINPHONE_EXEC} update_translations) add_dependencies(update_translations check_qml) -target_include_directories(${LINPHONE_EXEC} PRIVATE "${CMAKE_SOURCE_DIR}/../OUTPUT/desktop/include/") +target_include_directories(${LINPHONE_EXEC} SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/../OUTPUT/desktop/include/") target_link_libraries(${LINPHONE_EXEC} ${LIBS}) diff --git a/tests/assets/images/call_quality_0.svg b/tests/assets/images/call_quality_0.svg new file mode 100644 index 000000000..9a4c21f0f --- /dev/null +++ b/tests/assets/images/call_quality_0.svg @@ -0,0 +1,14 @@ + + + + call_quality_0 + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/call_quality_1.svg b/tests/assets/images/call_quality_1.svg new file mode 100644 index 000000000..0402c0a3d --- /dev/null +++ b/tests/assets/images/call_quality_1.svg @@ -0,0 +1,14 @@ + + + + call_quality_1 + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/call_quality_2.svg b/tests/assets/images/call_quality_2.svg new file mode 100644 index 000000000..ec37c72ef --- /dev/null +++ b/tests/assets/images/call_quality_2.svg @@ -0,0 +1,14 @@ + + + + call_quality_2 + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/call_quality_3.svg b/tests/assets/images/call_quality_3.svg new file mode 100644 index 000000000..816c7ca8e --- /dev/null +++ b/tests/assets/images/call_quality_3.svg @@ -0,0 +1,14 @@ + + + + call_quality_3 + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/camera_off_hovered.svg b/tests/assets/images/camera_off_hovered.svg new file mode 100644 index 000000000..6b2835676 --- /dev/null +++ b/tests/assets/images/camera_off_hovered.svg @@ -0,0 +1,13 @@ + + + + camera_on + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/camera_off_normal.svg b/tests/assets/images/camera_off_normal.svg new file mode 100644 index 000000000..61dcaf619 --- /dev/null +++ b/tests/assets/images/camera_off_normal.svg @@ -0,0 +1,14 @@ + + + + camera_off + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/camera_off_pressed.svg b/tests/assets/images/camera_off_pressed.svg new file mode 100644 index 000000000..75129b4d8 --- /dev/null +++ b/tests/assets/images/camera_off_pressed.svg @@ -0,0 +1,13 @@ + + + + camera_on_clic + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/camera_on_hovered.svg b/tests/assets/images/camera_on_hovered.svg new file mode 100644 index 000000000..61dcaf619 --- /dev/null +++ b/tests/assets/images/camera_on_hovered.svg @@ -0,0 +1,14 @@ + + + + camera_off + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/camera_on_normal.svg b/tests/assets/images/camera_on_normal.svg new file mode 100644 index 000000000..6b2835676 --- /dev/null +++ b/tests/assets/images/camera_on_normal.svg @@ -0,0 +1,13 @@ + + + + camera_on + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/camera_on_pressed.svg b/tests/assets/images/camera_on_pressed.svg new file mode 100644 index 000000000..cca0afc25 --- /dev/null +++ b/tests/assets/images/camera_on_pressed.svg @@ -0,0 +1,14 @@ + + + + camera_off_clic + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/chat_off_hovered.svg b/tests/assets/images/chat_off_hovered.svg new file mode 100644 index 000000000..9bcf53e5a --- /dev/null +++ b/tests/assets/images/chat_off_hovered.svg @@ -0,0 +1,15 @@ + + + + chat_on + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/chat_off_normal.svg b/tests/assets/images/chat_off_normal.svg new file mode 100644 index 000000000..3fb74a0fa --- /dev/null +++ b/tests/assets/images/chat_off_normal.svg @@ -0,0 +1,15 @@ + + + + chat_off + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/chat_off_pressed.svg b/tests/assets/images/chat_off_pressed.svg new file mode 100644 index 000000000..bb1ec9e89 --- /dev/null +++ b/tests/assets/images/chat_off_pressed.svg @@ -0,0 +1,15 @@ + + + + chat_on_off_clic + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/chat_on_hovered.svg b/tests/assets/images/chat_on_hovered.svg new file mode 100644 index 000000000..3fb74a0fa --- /dev/null +++ b/tests/assets/images/chat_on_hovered.svg @@ -0,0 +1,15 @@ + + + + chat_off + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/chat_on_normal.svg b/tests/assets/images/chat_on_normal.svg new file mode 100644 index 000000000..9bcf53e5a --- /dev/null +++ b/tests/assets/images/chat_on_normal.svg @@ -0,0 +1,15 @@ + + + + chat_on + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/chat_on_pressed.svg b/tests/assets/images/chat_on_pressed.svg new file mode 100644 index 000000000..bb1ec9e89 --- /dev/null +++ b/tests/assets/images/chat_on_pressed.svg @@ -0,0 +1,15 @@ + + + + chat_on_off_clic + Created with Sketch. + + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/fullscreen_hovered.svg b/tests/assets/images/fullscreen_hovered.svg new file mode 100644 index 000000000..ebc4cdcd3 --- /dev/null +++ b/tests/assets/images/fullscreen_hovered.svg @@ -0,0 +1,14 @@ + + + + fullscreen_over + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/fullscreen_normal.svg b/tests/assets/images/fullscreen_normal.svg new file mode 100644 index 000000000..bbc2491bc --- /dev/null +++ b/tests/assets/images/fullscreen_normal.svg @@ -0,0 +1,14 @@ + + + + fullscreen_default + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/fullscreen_pressed.svg b/tests/assets/images/fullscreen_pressed.svg new file mode 100644 index 000000000..ebc4cdcd3 --- /dev/null +++ b/tests/assets/images/fullscreen_pressed.svg @@ -0,0 +1,14 @@ + + + + fullscreen_over + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/options_hovered.svg b/tests/assets/images/options_hovered.svg new file mode 100644 index 000000000..573854bd0 --- /dev/null +++ b/tests/assets/images/options_hovered.svg @@ -0,0 +1,13 @@ + + + + options_over + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/options_normal.svg b/tests/assets/images/options_normal.svg new file mode 100644 index 000000000..c3b080307 --- /dev/null +++ b/tests/assets/images/options_normal.svg @@ -0,0 +1,13 @@ + + + + options_default + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/options_pressed.svg b/tests/assets/images/options_pressed.svg new file mode 100644 index 000000000..7046014e8 --- /dev/null +++ b/tests/assets/images/options_pressed.svg @@ -0,0 +1,13 @@ + + + + options_clic + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/pause_off_hovered.svg b/tests/assets/images/pause_off_hovered.svg new file mode 100644 index 000000000..d6aed7eab --- /dev/null +++ b/tests/assets/images/pause_off_hovered.svg @@ -0,0 +1,13 @@ + + + + play_over + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/pause_off_normal.svg b/tests/assets/images/pause_off_normal.svg new file mode 100644 index 000000000..e0ca25744 --- /dev/null +++ b/tests/assets/images/pause_off_normal.svg @@ -0,0 +1,13 @@ + + + + play_default + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/pause_off_pressed.svg b/tests/assets/images/pause_off_pressed.svg new file mode 100644 index 000000000..78e7e9bf2 --- /dev/null +++ b/tests/assets/images/pause_off_pressed.svg @@ -0,0 +1,13 @@ + + + + play_clic + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/pause_on_hovered.svg b/tests/assets/images/pause_on_hovered.svg new file mode 100644 index 000000000..bfad261f6 --- /dev/null +++ b/tests/assets/images/pause_on_hovered.svg @@ -0,0 +1,13 @@ + + + + pause_over + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/pause_on_normal.svg b/tests/assets/images/pause_on_normal.svg new file mode 100644 index 000000000..a2fde79f5 --- /dev/null +++ b/tests/assets/images/pause_on_normal.svg @@ -0,0 +1,13 @@ + + + + pause_default + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/pause_on_pressed.svg b/tests/assets/images/pause_on_pressed.svg new file mode 100644 index 000000000..c5d673033 --- /dev/null +++ b/tests/assets/images/pause_on_pressed.svg @@ -0,0 +1,13 @@ + + + + pause_clic + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/record_hovered.svg b/tests/assets/images/record_hovered.svg new file mode 100644 index 000000000..ed4de9499 --- /dev/null +++ b/tests/assets/images/record_hovered.svg @@ -0,0 +1,17 @@ + + + + record_over + Created with Sketch. + + + + + + + + REC + + + + \ No newline at end of file diff --git a/tests/assets/images/record_normal.svg b/tests/assets/images/record_normal.svg new file mode 100644 index 000000000..71c28d1e3 --- /dev/null +++ b/tests/assets/images/record_normal.svg @@ -0,0 +1,17 @@ + + + + record_default + Created with Sketch. + + + + + + + + REC + + + + \ No newline at end of file diff --git a/tests/assets/images/record_pressed.svg b/tests/assets/images/record_pressed.svg new file mode 100644 index 000000000..ed4de9499 --- /dev/null +++ b/tests/assets/images/record_pressed.svg @@ -0,0 +1,17 @@ + + + + record_over + Created with Sketch. + + + + + + + + REC + + + + \ No newline at end of file diff --git a/tests/assets/images/screenshot_hovered.svg b/tests/assets/images/screenshot_hovered.svg new file mode 100644 index 000000000..0708fe5b7 --- /dev/null +++ b/tests/assets/images/screenshot_hovered.svg @@ -0,0 +1,24 @@ + + + + screenshot_over + Created with Sketch. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/screenshot_normal.svg b/tests/assets/images/screenshot_normal.svg new file mode 100644 index 000000000..1d65b1e35 --- /dev/null +++ b/tests/assets/images/screenshot_normal.svg @@ -0,0 +1,24 @@ + + + + screenshot_default + Created with Sketch. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/images/screenshot_pressed.svg b/tests/assets/images/screenshot_pressed.svg new file mode 100644 index 000000000..0708fe5b7 --- /dev/null +++ b/tests/assets/images/screenshot_pressed.svg @@ -0,0 +1,24 @@ + + + + screenshot_over + Created with Sketch. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/assets/languages/en.ts b/tests/assets/languages/en.ts index 1edefb271..79f18ccc2 100644 --- a/tests/assets/languages/en.ts +++ b/tests/assets/languages/en.ts @@ -226,6 +226,17 @@ Display tooltips to discover Linphone Desktop + + IncomingCall + + incomingVideoCall + + + + incomingAudioCall + + + MainWindow @@ -311,6 +322,17 @@ CANCEL + + OutgoingCall + + outgoingVideoCall + + + + outgoingAudioCall + + + PresenceString diff --git a/tests/assets/languages/fr.ts b/tests/assets/languages/fr.ts index e6dd29cbd..50174c7ae 100644 --- a/tests/assets/languages/fr.ts +++ b/tests/assets/languages/fr.ts @@ -218,6 +218,17 @@ Afficher les tooltips pour découvrir Linphone Desktop + + IncomingCall + + incomingVideoCall + APPEL VIDEO ENTRANT + + + incomingAudioCall + APPEL AUDIO ENTRANT + + MainWindow @@ -303,6 +314,17 @@ ANNULER + + OutgoingCall + + outgoingVideoCall + APPEL VIDEO SORTANT + + + outgoingAudioCall + APPEL AUDIO SORTANT + + PresenceString diff --git a/tests/resources.qrc b/tests/resources.qrc index 3c6cc7253..c293c6a01 100644 --- a/tests/resources.qrc +++ b/tests/resources.qrc @@ -10,9 +10,25 @@ assets/images/call_hovered.svg assets/images/call_normal.svg assets/images/call_pressed.svg + assets/images/call_quality_0.svg + assets/images/call_quality_1.svg + assets/images/call_quality_2.svg + assets/images/call_quality_3.svg + assets/images/camera_off_hovered.svg + assets/images/camera_off_normal.svg + assets/images/camera_off_pressed.svg + assets/images/camera_on_hovered.svg + assets/images/camera_on_normal.svg + assets/images/camera_on_pressed.svg assets/images/chat_error.svg assets/images/chat_hovered.svg assets/images/chat_normal.svg + assets/images/chat_off_hovered.svg + assets/images/chat_off_normal.svg + assets/images/chat_off_pressed.svg + assets/images/chat_on_hovered.svg + assets/images/chat_on_normal.svg + assets/images/chat_on_pressed.svg assets/images/chat_pressed.svg assets/images/chat_send.svg assets/images/chevron_green.svg @@ -32,6 +48,9 @@ assets/images/delete_pressed.svg assets/images/ended_call.svg assets/images/filter.svg + assets/images/fullscreen_hovered.svg + assets/images/fullscreen_normal.svg + assets/images/fullscreen_pressed.svg assets/images/hangup_hovered.svg assets/images/hangup_normal.svg assets/images/hangup_pressed.svg @@ -52,7 +71,22 @@ assets/images/micro_on_pressed.svg assets/images/missed_incoming_call.svg assets/images/missed_outgoing_call.svg + assets/images/options_hovered.svg + assets/images/options_normal.svg + assets/images/options_pressed.svg assets/images/outgoing_call.svg + assets/images/pause_off_hovered.svg + assets/images/pause_off_normal.svg + assets/images/pause_off_pressed.svg + assets/images/pause_on_hovered.svg + assets/images/pause_on_normal.svg + assets/images/pause_on_pressed.svg + assets/images/record_hovered.svg + assets/images/record_normal.svg + assets/images/record_pressed.svg + assets/images/screenshot_hovered.svg + assets/images/screenshot_normal.svg + assets/images/screenshot_pressed.svg assets/images/search.svg assets/images/speaker_off_hovered.svg assets/images/speaker_off_normal.svg @@ -167,8 +201,9 @@ ui/scripts/Utils/qmldir ui/scripts/Utils/uri-tools.js ui/scripts/Utils/utils.js - ui/views/App/Calls/AbstractCall.qml + ui/views/App/Calls/AbstractStartingCall.qml ui/views/App/Calls/Calls.qml + ui/views/App/Calls/Incall.qml ui/views/App/Calls/IncomingCall.qml ui/views/App/Calls/OutgoingCall.qml ui/views/App/MainWindow/Contact.qml diff --git a/tests/src/components/chat/ChatProxyModel.hpp b/tests/src/components/chat/ChatProxyModel.hpp index c4f9b43f3..dd9a2e1ec 100644 --- a/tests/src/components/chat/ChatProxyModel.hpp +++ b/tests/src/components/chat/ChatProxyModel.hpp @@ -64,7 +64,7 @@ protected: private: QString getSipAddress () const { - static_cast(m_chat_model_filter.sourceModel())->getSipAddress(); + return static_cast(m_chat_model_filter.sourceModel())->getSipAddress(); } void setSipAddress (const QString &sip_address) { diff --git a/tests/ui/modules/Common/Image/Icon.qml b/tests/ui/modules/Common/Image/Icon.qml index 3b3e586db..bb6743e5a 100644 --- a/tests/ui/modules/Common/Image/Icon.qml +++ b/tests/ui/modules/Common/Image/Icon.qml @@ -11,15 +11,8 @@ Item { property var iconSize // Required. property string icon - Component.onCompleted: { - if (width == null) { - width = iconSize - } - - if (height == null) { - height = iconSize - } - } + height: iconSize + width: iconSize Image { function _checkIconSize () { diff --git a/tests/ui/modules/Common/Menu/Menu.qml b/tests/ui/modules/Common/Menu/Menu.qml index f9d16c7b5..5e9ed2393 100644 --- a/tests/ui/modules/Common/Menu/Menu.qml +++ b/tests/ui/modules/Common/Menu/Menu.qml @@ -71,7 +71,6 @@ Rectangle { : '_normal' ) iconSize: MenuStyle.entry.iconSize - Layout.preferredWidth: iconSize } Text { diff --git a/tests/ui/modules/Common/Paned.qml b/tests/ui/modules/Common/Paned.qml index 5daddc49f..4946cf704 100644 --- a/tests/ui/modules/Common/Paned.qml +++ b/tests/ui/modules/Common/Paned.qml @@ -39,7 +39,6 @@ Item { property var minimumRightLimit: 0 property bool _isClosed - property int _savedContentAWidth // Internal limits. property var _maximumLeftLimit @@ -47,6 +46,28 @@ Item { property var _minimumLeftLimit property var _minimumRightLimit + // ----------------------------------------------------------------- + // Public functions. + // ----------------------------------------------------------------- + + function isClosed () { + return _isClosed + } + + function open () { + if (_isClosed) { + openingTransition.running = true + } + } + + function close () { + if (!_isClosed) { + _close() + } + } + + // ----------------------------------------------------------------- + // Private functions. // ----------------------------------------------------------------- function _getLimitValue (limit) { @@ -188,7 +209,6 @@ Item { function _close () { _isClosed = true - _savedContentAWidth = contentA.width closingTransition.running = true } @@ -227,7 +247,6 @@ Item { : defaultChildAWidth _isClosed = defaultClosed - _savedContentAWidth = contentA.width } Item { @@ -279,7 +298,9 @@ Item { duration: PanedStyle.transitionDuration property: 'width' target: contentA - to: _savedContentAWidth + to: closingEdge === Qt.LeftEdge + ? minimumLeftLimit + : container.width - minimumRightLimit - handle.width onRunningChanged: !running && _open() } diff --git a/tests/ui/modules/Linphone/Chat/Chat.qml b/tests/ui/modules/Linphone/Chat/Chat.qml index c7169a98d..0683cac59 100644 --- a/tests/ui/modules/Linphone/Chat/Chat.qml +++ b/tests/ui/modules/Linphone/Chat/Chat.qml @@ -10,11 +10,12 @@ import Utils 1.0 // =================================================================== ColumnLayout { - property var contact - - // Can be a model or a proxy chat model. property alias proxyModel: chat.model + property var _contact: ContactsListModel.mapSipAddressToContact( + proxyModel.sipAddress + ) || proxyModel.sipAddress + // ----------------------------------------------------------------- spacing: 0 diff --git a/tests/ui/modules/Linphone/Chat/IncomingMessage.qml b/tests/ui/modules/Linphone/Chat/IncomingMessage.qml index 652ff63a3..042ab4739 100644 --- a/tests/ui/modules/Linphone/Chat/IncomingMessage.qml +++ b/tests/ui/modules/Linphone/Chat/IncomingMessage.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 import Linphone.Styles 1.0 +import LinphoneUtils 1.0 // =================================================================== @@ -19,7 +20,7 @@ RowLayout { Avatar { anchors.centerIn: parent height: ChatStyle.entry.message.incoming.avatarSize - username: contact.username + username: LinphoneUtils.getContactUsername(_contact) width: ChatStyle.entry.message.incoming.avatarSize } } diff --git a/tests/ui/views/App/Calls/AbstractCall.qml b/tests/ui/views/App/Calls/AbstractStartingCall.qml similarity index 100% rename from tests/ui/views/App/Calls/AbstractCall.qml rename to tests/ui/views/App/Calls/AbstractStartingCall.qml index a84a6881d..56cdd6a1f 100644 --- a/tests/ui/views/App/Calls/AbstractCall.qml +++ b/tests/ui/views/App/Calls/AbstractStartingCall.qml @@ -64,10 +64,10 @@ Rectangle { ContactDescription { id: contactDescription - username: LinphoneUtils.getContactUsername(_contact) - sipAddress: abstractCall.sipAddress height: StartingCallStyle.contactDescriptionHeight horizontalTextAlignment: Text.AlignHCenter + sipAddress: abstractCall.sipAddress + username: LinphoneUtils.getContactUsername(_contact) width: parent.width } } @@ -79,8 +79,8 @@ Rectangle { Item { id: container - Layout.fillWidth: true Layout.fillHeight: true + Layout.fillWidth: true Layout.margins: StartingCallStyle.containerMargins Avatar { diff --git a/tests/ui/views/App/Calls/Calls.qml b/tests/ui/views/App/Calls/Calls.qml index b963e8d6b..852967596 100644 --- a/tests/ui/views/App/Calls/Calls.qml +++ b/tests/ui/views/App/Calls/Calls.qml @@ -19,8 +19,8 @@ Window { Paned { anchors.fill: parent defaultChildAWidth: 250 - maximumLeftLimit: 300 - minimumLeftLimit: 150 + maximumLeftLimit: 250 + minimumLeftLimit: 110 // --------------------------------------------------------------- // Calls list. @@ -76,120 +76,26 @@ Window { childB: Paned { anchors.fill: parent closingEdge: Qt.RightEdge - defaultChildAWidth: 300 defaultClosed: true - minimumLeftLimit: 350 - minimumRightLimit: 250 + minimumLeftLimit: 380 + minimumRightLimit: 300 resizeAInPriority: true // Call. - childA: OutgoingCall { + childA: Incall { anchors.fill: parent sipAddress: 'sip:erwan.croze@sip.linphone.org' } - childB: Rectangle { - anchors.fill: parent - color: 'green' - } - // Chat. - //childB: Chat { - // anchors.fill: parent - //} - } - } + childB: Chat { + anchors.fill: parent + proxyModel: ChatProxyModel { + id: chatProxyModel - // ----------------------------------------------------------------- - // TMP - // ----------------------------------------------------------------- - - ListModel { - id: callsList - - ListElement { - $presence: 'do_not_disturb' - $sipAddress: 'charles.henri.sip.linphone.org' - } - ListElement { - $presence: 'disconnected' - $sipAddress: 'yesyes.nono.sip.linphone.org' - } - ListElement { - $presence: 'connected' - $sipAddress: 'nsa.sip.linphone.org' - } - ListElement { - $presence: 'do_not_disturb' - $sipAddress: 'charles.henri.sip.linphone.org' - } - ListElement { - $presence: 'disconnected' - $sipAddress: 'yesyes.nono.sip.linphone.org' - } - ListElement { - $presence: 'connected' - $sipAddress: 'nsa.sip.linphone.org' - } - ListElement { - $presence: 'do_not_disturb' - $sipAddress: 'charles.henri.sip.linphone.org' - } - ListElement { - $presence: 'disconnected' - $sipAddress: 'yesyes.nono.sip.linphone.org' - } - ListElement { - $presence: 'connected' - $sipAddress: 'nsa.sip.linphone.org' - } - ListElement { - $presence: 'do_not_disturb' - $sipAddress: 'charles.henri.sip.linphone.org' - } - ListElement { - $presence: 'disconnected' - $sipAddress: 'yesyes.nono.sip.linphone.org' - } - ListElement { - $presence: 'connected' - $sipAddress: 'nsa.sip.linphone.org' - } - ListElement { - $presence: 'do_not_disturb' - $sipAddress: 'charles.henri.sip.linphone.org' - } - ListElement { - $presence: 'disconnected' - $sipAddress: 'yesyes.nono.sip.linphone.org' - } - ListElement { - $presence: 'connected' - $sipAddress: 'nsa.sip.linphone.org' - } - ListElement { - $presence: 'do_not_disturb' - $sipAddress: 'charles.henri.sip.linphone.org' - } - ListElement { - $presence: 'disconnected' - $sipAddress: 'yesyes.nono.sip.linphone.org' - } - ListElement { - $presence: 'connected' - $sipAddress: 'nsa.sip.linphone.org' - } - ListElement { - $presence: 'do_not_disturb' - $sipAddress: 'charles.henri.sip.linphone.org' - } - ListElement { - $presence: 'disconnected' - $sipAddress: 'yesyes.nono.sip.linphone.org' - } - ListElement { - $presence: 'connected' - $sipAddress: 'nsa.sip.linphone.org' + sipAddress: 'sip:erwan.croze@sip.linphone.org' + } + } } } } diff --git a/tests/ui/views/App/Calls/Incall.qml b/tests/ui/views/App/Calls/Incall.qml new file mode 100644 index 000000000..2ff80bfb5 --- /dev/null +++ b/tests/ui/views/App/Calls/Incall.qml @@ -0,0 +1,192 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.3 + +import Common 1.0 +import Linphone 1.0 +import LinphoneUtils 1.0 + +import App.Styles 1.0 + +// =================================================================== + +Rectangle { + id: call + + property bool isVideoCall: false + property string sipAddress + + property var _contact: ContactsListModel.mapSipAddressToContact( + sipAddress + ) || sipAddress + + // ----------------------------------------------------------------- + + color: StartingCallStyle.backgroundColor + + ColumnLayout { + anchors { + fill: parent + topMargin: StartingCallStyle.header.topMargin + } + + spacing: 0 + + // --------------------------------------------------------------- + // Call info. + // --------------------------------------------------------------- + + RowLayout { + id: info + + Layout.fillWidth: true + Layout.leftMargin: 20 + Layout.rightMargin: 20 + Layout.preferredHeight: StartingCallStyle.contactDescriptionHeight + + Icon { + iconSize: 40 + icon: 'call_quality_' + 2 + } + + Item { + Layout.fillWidth: true + } + + ActionBar { + iconSize: 40 + + ActionButton { + icon: 'screenshot' + } + + ActionButton { + icon: 'record' + } + + ActionButton { + icon: 'fullscreen' + } + } + } + + ContactDescription { + id: contactDescription + + anchors.fill: info + username: LinphoneUtils.getContactUsername(_contact) + sipAddress: call.sipAddress + horizontalTextAlignment: Text.AlignHCenter + } + + // --------------------------------------------------------------- + // Contact visual. + // --------------------------------------------------------------- + + Item { + id: container + + Layout.fillWidth: true + Layout.fillHeight: true + Layout.margins: StartingCallStyle.containerMargins + + Avatar { + id: avatar + + function _computeAvatarSize () { + var height = container.height + var width = container.width + + var size = height < StartingCallStyle.avatar.maxSize && height > 0 + ? height + : StartingCallStyle.avatar.maxSize + return size < width ? size : width + } + + anchors.centerIn: parent + backgroundColor: StartingCallStyle.avatar.backgroundColor + image: _contact.avatar + username: contactDescription.username + + height: _computeAvatarSize() + width: height + } + } + + // --------------------------------------------------------------- + // Buttons. + // --------------------------------------------------------------- + + Item { + Layout.fillWidth: true + Layout.preferredHeight: StartingCallStyle.actionAreaHeight + 10 + + ActionBar { + anchors { + left: parent.left + leftMargin: StartingCallStyle.leftButtonsGroupMargin + verticalCenter: parent.verticalCenter + } + iconSize: StartingCallStyle.iconSize + + ActionSwitch { + icon: 'micro' + onClicked: enabled = !enabled + } + + ActionSwitch { + icon: 'speaker' + onClicked: enabled = !enabled + } + + ActionSwitch { + icon: 'camera' + onClicked: enabled = !enabled + } + + ActionButton { + icon: 'options' + } + } + + Rectangle { + anchors.centerIn: parent + color: 'red' + height: StartingCallStyle.userVideo.height + visible: true + width: StartingCallStyle.userVideo.width + } + + ActionBar { + anchors { + right: parent.right + rightMargin: StartingCallStyle.rightButtonsGroupMargin + verticalCenter: parent.verticalCenter + } + iconSize: StartingCallStyle.iconSize + + ActionSwitch { + icon: 'pause' + onClicked: enabled = !enabled + } + + ActionButton { + icon: 'hangup' + } + + ActionSwitch { + enabled: !call.parent.parent.isClosed() + icon: 'chat' + onClicked: { + var parent = call.parent.parent + + if (enabled) { + parent.close() + } else { + parent.open() + } + } + } + } + } + } +} diff --git a/tests/ui/views/App/Calls/IncomingCall.qml b/tests/ui/views/App/Calls/IncomingCall.qml index ac36970aa..ec4ec858d 100644 --- a/tests/ui/views/App/Calls/IncomingCall.qml +++ b/tests/ui/views/App/Calls/IncomingCall.qml @@ -1,15 +1,17 @@ import Common 1.0 +import App.Styles 1.0 + // =================================================================== -AbstractCall { +AbstractStartingCall { callTypeLabel: isVideoCall - ? 'INCOMING VIDEO CALL' - : 'INCOMING AUDIO CALL' + ? qsTr('incomingVideoCall') + : qsTr('incomingAudioCall') ActionBar { anchors.centerIn: parent - iconSize: 40 + iconSize: StartingCallStyle.iconSize ActionButton { icon: 'video_call_accept' @@ -24,9 +26,9 @@ AbstractCall { anchors { verticalCenter: parent.verticalCenter right: parent.right - rightMargin: 85 + rightMargin: StartingCallStyle.rightButtonsGroupMargin } - iconSize: 40 + iconSize: StartingCallStyle.iconSize ActionButton { icon: 'hangup' diff --git a/tests/ui/views/App/Calls/OutgoingCall.qml b/tests/ui/views/App/Calls/OutgoingCall.qml index 02b8fde6c..7566fea1c 100644 --- a/tests/ui/views/App/Calls/OutgoingCall.qml +++ b/tests/ui/views/App/Calls/OutgoingCall.qml @@ -2,21 +2,23 @@ import QtQuick 2.7 import Common 1.0 +import App.Styles 1.0 + // =================================================================== -AbstractCall { +AbstractStartingCall { isOutgoing: true callTypeLabel: isVideoCall - ? 'OUTGOING VIDEO CALL' - : 'OUTGOING AUDIO CALL' + ? qsTr('outgoingVideoCall') + : qsTr('outgoingAudioCall') ActionBar { anchors { left: parent.left - leftMargin: 50 + leftMargin: StartingCallStyle.leftButtonsGroupMargin verticalCenter: parent.verticalCenter } - iconSize: 40 + iconSize: StartingCallStyle.iconSize ActionSwitch { icon: 'micro' @@ -32,18 +34,18 @@ AbstractCall { Rectangle { anchors.centerIn: parent color: 'red' - width: 130 - height: 80 + height: StartingCallStyle.userVideo.height visible: isVideoCall + width: StartingCallStyle.userVideo.width } ActionBar { anchors { verticalCenter: parent.verticalCenter right: parent.right - rightMargin: 85 + rightMargin: StartingCallStyle.rightButtonsGroupMargin } - iconSize: 40 + iconSize: StartingCallStyle.iconSize ActionButton { icon: 'hangup' diff --git a/tests/ui/views/App/MainWindow/Conversation.qml b/tests/ui/views/App/MainWindow/Conversation.qml index 322558600..8c46f0601 100644 --- a/tests/ui/views/App/MainWindow/Conversation.qml +++ b/tests/ui/views/App/MainWindow/Conversation.qml @@ -153,7 +153,6 @@ ColumnLayout { Chat { Layout.fillHeight: true Layout.fillWidth: true - contact: parent._contact proxyModel: ChatProxyModel { id: chatProxyModel diff --git a/tests/ui/views/App/ManageAccounts.qml b/tests/ui/views/App/ManageAccounts.qml index 01e411f41..ebf5fce0c 100644 --- a/tests/ui/views/App/ManageAccounts.qml +++ b/tests/ui/views/App/ManageAccounts.qml @@ -65,8 +65,8 @@ DialogPlus { // Presence. Icon { - Layout.preferredHeight: 20 - Layout.preferredWidth: 20 + Layout.preferredHeight: 20 // TMP + Layout.preferredWidth: 20 // TMP icon: 'led_' + $presence } diff --git a/tests/ui/views/App/Styles/Calls/StartingCallStyle.qml b/tests/ui/views/App/Styles/Calls/StartingCallStyle.qml index 5f235652a..60f31a0c0 100644 --- a/tests/ui/views/App/Styles/Calls/StartingCallStyle.qml +++ b/tests/ui/views/App/Styles/Calls/StartingCallStyle.qml @@ -6,23 +6,31 @@ import Common 1.0 // =================================================================== QtObject { - property color backgroundColor: '#E8E8E8' + property color backgroundColor: Colors.f property int actionAreaHeight: 100 property int contactDescriptionHeight: 60 property int containerMargins: 20 + property int iconSize: 40 + property int leftButtonsGroupMargin: 50 + property int rightButtonsGroupMargin: 85 + + property QtObject avatar: QtObject { + property color backgroundColor: Colors.w + property int maxSize: 300 + } + + property QtObject callType: QtObject { + property color color: Colors.x + property int fontSize: 17 + } property QtObject header: QtObject { property int spacing: 10 property int topMargin: 26 } - property QtObject avatar: QtObject { - property color backgroundColor: '#A1A1A1' - property int maxSize: 300 - } - - property QtObject callType: QtObject { - property color color: '#96A5B1' - property int fontSize: 17 + property QtObject userVideo: QtObject { + property int width: 130 + property int height: 90 } }