mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-07 15:08:24 +00:00
42 lines
1.2 KiB
QML
42 lines
1.2 KiB
QML
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.peerAddress, call.localAddress)
|
|
readonly property var _username: LinphoneUtils.getContactUsername(_sipAddressObserver)
|
|
|
|
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
|
|
}
|
|
}
|