fix(ui/views/App/Calls/Incall): remove letters when call is paused on avatar

This commit is contained in:
Ronan Abhamon 2017-06-09 11:59:30 +02:00
parent 98af40d801
commit 1dce1fefd1
4 changed files with 53 additions and 39 deletions

View file

@ -370,6 +370,7 @@
<file>ui/views/App/Calls/Dialogs/CallTransfer.qml</file>
<file>ui/views/App/Calls/Dialogs/ConferenceManager.qml</file>
<file>ui/views/App/Calls/EndedCall.qml</file>
<file>ui/views/App/Calls/IncallAvatar.qml</file>
<file>ui/views/App/Calls/IncallFullscreenWindow.qml</file>
<file>ui/views/App/Calls/Incall.js</file>
<file>ui/views/App/Calls/Incall.qml</file>

View file

@ -135,7 +135,7 @@ Rectangle {
username: LinphoneUtils.getContactUsername(parent.sipAddressObserver.contact || parent.sipAddress)
}
Avatar {
IncallAvatar {
readonly property int size: Math.min(
parent.width,
parent.height - contactDescription.height - parent.spacing
@ -143,29 +143,20 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
call: $call
height: size
width: size
backgroundColor: CallStyle.container.avatar.backgroundColor
foregroundColor: $call && $call.status === CallModel.CallStatusPaused
? CallStyle.container.pause.color
: 'transparent'
image: {
var contact = parent.sipAddressObserver.contact
if (contact) {
return contact.vcard.avatar
}
}
username: contactDescription.username
BusyIndicator {
anchors {
horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter
}
color: CallStyle.header.busyIndicator.color
height: CallStyle.header.busyIndicator.height
width: CallStyle.header.busyIndicator.width
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: $call && $call.status === CallModel.CallStatusOutgoing
}

View file

@ -200,31 +200,11 @@ Rectangle {
Component {
id: avatar
Avatar {
backgroundColor: CallStyle.container.avatar.backgroundColor
foregroundColor: incall.call.status === CallModel.CallStatusPaused
? CallStyle.container.pause.color
: 'transparent'
image: _sipAddressObserver.contact && _sipAddressObserver.contact.vcard.avatar
username: contactDescription.username
IncallAvatar {
call: incall.call
height: Logic.computeAvatarSize(CallStyle.container.avatar.maxSize)
width: height
Text {
anchors.fill: parent
color: CallStyle.container.pause.text.color
// `|| 1` => `pointSize` must be greater than 0.
font.pointSize: (width / CallStyle.container.pause.text.pointSizeFactor) || 1
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: '&#9616;&nbsp;&#9612;'
textFormat: Text.RichText
visible: incall.call.status === CallModel.CallStatusPaused
}
}
}

View file

@ -0,0 +1,42 @@
import QtQuick 2.7
import Linphone 1.0
import LinphoneUtils 1.0
import App.Styles 1.0
// =============================================================================
Avatar {
property var call
readonly property var _sipAddressObserver: SipAddressesModel.getSipAddressObserver(call.sipAddress)
readonly property var _username: LinphoneUtils.getContactUsername(_sipAddressObserver.contact || call.sipAddress)
backgroundColor: CallStyle.container.avatar.backgroundColor
foregroundColor: call.status === CallModel.CallStatusPaused
? CallStyle.container.pause.color
: 'transparent'
image: {
var contact = _sipAddressObserver.contact
return contact && contact.vcard.avatar
}
username: call.status === CallModel.CallStatusPaused ? '' : _username
Text {
anchors.fill: parent
color: CallStyle.container.pause.text.color
// `|| 1` => `pointSize` must be greater than 0.
font.pointSize: (width / CallStyle.container.pause.text.pointSizeFactor) || 1
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: '&#9616;&nbsp;&#9612;'
textFormat: Text.RichText
visible: call.status === CallModel.CallStatusPaused
}
}