mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-30 16:06:24 +00:00
fix(ui/views/App/Calls/Incall): remove letters when call is paused on avatar
This commit is contained in:
parent
98af40d801
commit
1dce1fefd1
4 changed files with 53 additions and 39 deletions
|
|
@ -370,6 +370,7 @@
|
||||||
<file>ui/views/App/Calls/Dialogs/CallTransfer.qml</file>
|
<file>ui/views/App/Calls/Dialogs/CallTransfer.qml</file>
|
||||||
<file>ui/views/App/Calls/Dialogs/ConferenceManager.qml</file>
|
<file>ui/views/App/Calls/Dialogs/ConferenceManager.qml</file>
|
||||||
<file>ui/views/App/Calls/EndedCall.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/IncallFullscreenWindow.qml</file>
|
||||||
<file>ui/views/App/Calls/Incall.js</file>
|
<file>ui/views/App/Calls/Incall.js</file>
|
||||||
<file>ui/views/App/Calls/Incall.qml</file>
|
<file>ui/views/App/Calls/Incall.qml</file>
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ Rectangle {
|
||||||
username: LinphoneUtils.getContactUsername(parent.sipAddressObserver.contact || parent.sipAddress)
|
username: LinphoneUtils.getContactUsername(parent.sipAddressObserver.contact || parent.sipAddress)
|
||||||
}
|
}
|
||||||
|
|
||||||
Avatar {
|
IncallAvatar {
|
||||||
readonly property int size: Math.min(
|
readonly property int size: Math.min(
|
||||||
parent.width,
|
parent.width,
|
||||||
parent.height - contactDescription.height - parent.spacing
|
parent.height - contactDescription.height - parent.spacing
|
||||||
|
|
@ -143,29 +143,20 @@ Rectangle {
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
call: $call
|
||||||
|
|
||||||
height: size
|
height: size
|
||||||
width: 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 {
|
BusyIndicator {
|
||||||
|
anchors {
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
color: CallStyle.header.busyIndicator.color
|
color: CallStyle.header.busyIndicator.color
|
||||||
height: CallStyle.header.busyIndicator.height
|
height: CallStyle.header.busyIndicator.height
|
||||||
width: CallStyle.header.busyIndicator.width
|
width: CallStyle.header.busyIndicator.width
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
visible: $call && $call.status === CallModel.CallStatusOutgoing
|
visible: $call && $call.status === CallModel.CallStatusOutgoing
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,31 +200,11 @@ Rectangle {
|
||||||
Component {
|
Component {
|
||||||
id: avatar
|
id: avatar
|
||||||
|
|
||||||
Avatar {
|
IncallAvatar {
|
||||||
backgroundColor: CallStyle.container.avatar.backgroundColor
|
call: incall.call
|
||||||
foregroundColor: incall.call.status === CallModel.CallStatusPaused
|
|
||||||
? CallStyle.container.pause.color
|
|
||||||
: 'transparent'
|
|
||||||
image: _sipAddressObserver.contact && _sipAddressObserver.contact.vcard.avatar
|
|
||||||
username: contactDescription.username
|
|
||||||
|
|
||||||
height: Logic.computeAvatarSize(CallStyle.container.avatar.maxSize)
|
height: Logic.computeAvatarSize(CallStyle.container.avatar.maxSize)
|
||||||
width: height
|
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: '▐ ▌'
|
|
||||||
textFormat: Text.RichText
|
|
||||||
visible: incall.call.status === CallModel.CallStatusPaused
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
42
linphone-desktop/ui/views/App/Calls/IncallAvatar.qml
Normal file
42
linphone-desktop/ui/views/App/Calls/IncallAvatar.qml
Normal 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: '▐ ▌'
|
||||||
|
textFormat: Text.RichText
|
||||||
|
visible: call.status === CallModel.CallStatusPaused
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue