From 05b6b43e4a9f45d86f471f1a1d4e5b8fb8082dd2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Dec 2016 09:57:14 +0100 Subject: [PATCH] feat(app): calls views in progress --- tests/ui/modules/Common/Form/ActionButton.qml | 2 -- tests/ui/modules/Common/Form/ActionSwitch.qml | 1 + tests/ui/views/App/Calls/Calls.qml | 3 ++- tests/ui/views/App/Calls/Incall.qml | 17 +++++++++++++---- tests/ui/views/App/Calls/OutgoingCall.qml | 12 ++++++++++-- .../App/Styles/Calls/StartingCallStyle.qml | 2 +- 6 files changed, 27 insertions(+), 10 deletions(-) diff --git a/tests/ui/modules/Common/Form/ActionButton.qml b/tests/ui/modules/Common/Form/ActionButton.qml index 3a17b3368..d36ab6248 100644 --- a/tests/ui/modules/Common/Form/ActionButton.qml +++ b/tests/ui/modules/Common/Form/ActionButton.qml @@ -38,8 +38,6 @@ Button { } hoverEnabled: true - // Ugly hack, use current size, ActionBar size, - // or other parent height. height: iconSize || parent.iconSize || parent.height width: iconSize || parent.iconSize || parent.height diff --git a/tests/ui/modules/Common/Form/ActionSwitch.qml b/tests/ui/modules/Common/Form/ActionSwitch.qml index 6dc313acb..30a6ea9ae 100644 --- a/tests/ui/modules/Common/Form/ActionSwitch.qml +++ b/tests/ui/modules/Common/Form/ActionSwitch.qml @@ -21,6 +21,7 @@ Item { anchors.fill: parent icon: parent.icon + (parent.enabled ? '_on' : '_off') + iconSize: parent.iconSize onClicked: parent.clicked() } diff --git a/tests/ui/views/App/Calls/Calls.qml b/tests/ui/views/App/Calls/Calls.qml index 852967596..8be5b284f 100644 --- a/tests/ui/views/App/Calls/Calls.qml +++ b/tests/ui/views/App/Calls/Calls.qml @@ -77,7 +77,7 @@ Window { anchors.fill: parent closingEdge: Qt.RightEdge defaultClosed: true - minimumLeftLimit: 380 + minimumLeftLimit: 395 minimumRightLimit: 300 resizeAInPriority: true @@ -85,6 +85,7 @@ Window { childA: Incall { anchors.fill: parent sipAddress: 'sip:erwan.croze@sip.linphone.org' + isVideoCall: true } // Chat. diff --git a/tests/ui/views/App/Calls/Incall.qml b/tests/ui/views/App/Calls/Incall.qml index 2ff80bfb5..f940b3cec 100644 --- a/tests/ui/views/App/Calls/Incall.qml +++ b/tests/ui/views/App/Calls/Incall.qml @@ -2,6 +2,7 @@ import QtQuick 2.7 import QtQuick.Layouts 1.3 import Common 1.0 +import Common.Styles 1.0 import Linphone 1.0 import LinphoneUtils 1.0 @@ -118,33 +119,41 @@ Rectangle { Item { Layout.fillWidth: true - Layout.preferredHeight: StartingCallStyle.actionAreaHeight + 10 + Layout.preferredHeight: StartingCallStyle.actionAreaHeight - ActionBar { + GridLayout { anchors { left: parent.left leftMargin: StartingCallStyle.leftButtonsGroupMargin verticalCenter: parent.verticalCenter } - iconSize: StartingCallStyle.iconSize + + rowSpacing: ActionBarStyle.spacing + columns: call.width < 645 && isVideoCall ? 2 : 4 ActionSwitch { icon: 'micro' + iconSize: StartingCallStyle.iconSize onClicked: enabled = !enabled } ActionSwitch { icon: 'speaker' + iconSize: StartingCallStyle.iconSize onClicked: enabled = !enabled } ActionSwitch { icon: 'camera' + iconSize: StartingCallStyle.iconSize onClicked: enabled = !enabled } ActionButton { + Layout.preferredHeight: StartingCallStyle.iconSize + Layout.preferredWidth: StartingCallStyle.iconSize icon: 'options' + iconSize: StartingCallStyle.iconSize } } @@ -152,7 +161,7 @@ Rectangle { anchors.centerIn: parent color: 'red' height: StartingCallStyle.userVideo.height - visible: true + visible: call.width >= 550 width: StartingCallStyle.userVideo.width } diff --git a/tests/ui/views/App/Calls/OutgoingCall.qml b/tests/ui/views/App/Calls/OutgoingCall.qml index 7566fea1c..b89f39f67 100644 --- a/tests/ui/views/App/Calls/OutgoingCall.qml +++ b/tests/ui/views/App/Calls/OutgoingCall.qml @@ -1,6 +1,8 @@ import QtQuick 2.7 +import QtQuick.Layouts 1.3 import Common 1.0 +import Common.Styles 1.0 import App.Styles 1.0 @@ -12,21 +14,27 @@ AbstractStartingCall { ? qsTr('outgoingVideoCall') : qsTr('outgoingAudioCall') - ActionBar { + GridLayout { + rowSpacing: ActionBarStyle.spacing + columns: parent.width < 415 && isVideoCall ? 1 : 2 + anchors { left: parent.left leftMargin: StartingCallStyle.leftButtonsGroupMargin verticalCenter: parent.verticalCenter } - iconSize: StartingCallStyle.iconSize ActionSwitch { icon: 'micro' + iconSize: StartingCallStyle.iconSize + onClicked: enabled = !enabled } ActionSwitch { icon: 'speaker' + iconSize: StartingCallStyle.iconSize + onClicked: enabled = !enabled } } diff --git a/tests/ui/views/App/Styles/Calls/StartingCallStyle.qml b/tests/ui/views/App/Styles/Calls/StartingCallStyle.qml index 60f31a0c0..304ab21eb 100644 --- a/tests/ui/views/App/Styles/Calls/StartingCallStyle.qml +++ b/tests/ui/views/App/Styles/Calls/StartingCallStyle.qml @@ -12,7 +12,7 @@ QtObject { property int containerMargins: 20 property int iconSize: 40 property int leftButtonsGroupMargin: 50 - property int rightButtonsGroupMargin: 85 + property int rightButtonsGroupMargin: 50 property QtObject avatar: QtObject { property color backgroundColor: Colors.w