Stickers: names, addresses, mute decoration, sizes

This commit is contained in:
Julien Wadel 2024-04-24 15:32:05 +02:00
parent fdbd8dbc87
commit 3c1cde46f7
7 changed files with 68 additions and 19 deletions

View file

@ -666,7 +666,7 @@ Window {
Component {
id: screencastPanel
ScreencastPanel {
call: mainwindow.call
call: mainWindow.call
Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Partage de votre écran")
}
}

View file

@ -25,6 +25,10 @@ RowLayout {
Layout.preferredHeight: 330 * DefaultStyle.dp
Layout.preferredWidth: 558 * DefaultStyle.dp
qmlName: "WP"
displayAll: false
displayPresence: false
bigBottomAddress: true
mutedStatus: microButton.checked
AccountProxy{
id: accounts
}

View file

@ -10,18 +10,19 @@ Button {
property string checkedIconUrl
property color color: DefaultStyle.grey_500
property color checkedColor: color
property color backgroundColor: mainItem.enabled
? mainItem.pressed || mainItem.checked
? mainItem.checkedColor
: mainItem.color
: DefaultStyle.grey_600
checkable: true
background: Rectangle {
anchors.fill: parent
color: mainItem.enabled
? mainItem.pressed || mainItem.checked
? mainItem.checkedColor
: mainItem.color
: DefaultStyle.grey_600
color: mainItem.backgroundColor
radius: mainItem.width * 1.29
}
icon.source: checkedIconUrl && mainItem.checked ? checkedIconUrl : iconUrl
icon.width: width * 0.58
icon.height: width * 0.58
contentImageColor: enabled ? DefaultStyle.grey_0 : DefaultStyle.grey_500
}
}

View file

@ -32,6 +32,9 @@ StackView {
onHaveAvatarChanged: replace(haveAvatar ? avatar : initials, StackView.Immediate)
property bool secured: false
property bool displayPresence: (account || contact) && (account
? account.core.registrationState != LinphoneEnums.RegistrationState.Progress && account.core.registrationState != LinphoneEnums.RegistrationState.Refreshing
: contact.core.consolidatedPresence != LinphoneEnums.ConsolidatedPresence.Offline)
initialItem: haveAvatar ? avatar : initials
@ -57,9 +60,7 @@ StackView {
}
}
Rectangle {
visible: (account || contact) && (account
? account.core.registrationState != LinphoneEnums.RegistrationState.Progress && account.core.registrationState != LinphoneEnums.RegistrationState.Refreshing
: contact.core.consolidatedPresence != LinphoneEnums.ConsolidatedPresence.Offline)
visible: mainItem.displayPresence
width: mainItem.width/4.5
height: width
radius: width / 2
@ -110,10 +111,12 @@ StackView {
}
}
Image {
visible: initialItem.initials.length === 0
visible: initialItem.initials == ''
width: mainItem.width/3
height: width
source: AppIcons.profile
sourceSize.width: width
sourceSize.height: height
anchors.centerIn: parent
}
}

View file

@ -19,6 +19,7 @@ Item {
property AccountGui account: null
property ParticipantDeviceGui participantDevice: null
property bool displayBorder : participantDevice && participantDevice.core.isSpeaking || false
property alias displayPresence: avatar.displayPresence
property color color: DefaultStyle.grey_600
property int radius: 15 * DefaultStyle.dp
property var peerAddressObj: previewEnabled && (call || account)
@ -34,6 +35,9 @@ Item {
property bool videoEnabled: (previewEnabled && call && call.core.localVideoEnabled)
|| (participantDevice && participantDevice.core.videoEnabled)
property string qmlName
property bool displayAll : !!mainItem.call
property bool bigBottomAddress: displayAll
property bool mutedStatus: participantDevice ? participantDevice.core.isMuted : false
Rectangle {
id: background
@ -42,22 +46,27 @@ Item {
anchors.fill: parent
border.color: DefaultStyle.main2_200
border.width: mainItem.displayBorder ? 3 * DefaultStyle.dp : 0
property int minSize: Math.min(height, width)
ColumnLayout {
id: noCameraLayout
anchors.centerIn: parent
anchors.fill: parent
spacing: 0
visible: !cameraLoader.active || cameraLoader.status != Loader.Ready || !cameraLoader.item.isReady
Avatar{
id: avatar
Layout.alignment: Qt.AlignHCenter
height: 100
width: height
// minSize = 372 => avatar = 142
Layout.preferredHeight: background.minSize * 142 / 372
Layout.preferredWidth: height
account: mainItem.account
call: !mainItem.previewEnabled ? mainItem.call : null
address: mainItem.peerAddress
}
Text {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.topMargin: 15 * DefaultStyle.dp
visible: mainItem.call && mainItem.call != undefined
horizontalAlignment: Text.AlignHCenter
visible: mainItem.displayAll
text: mainItem.peerAddress
color: DefaultStyle.grey_0
font {
@ -67,8 +76,9 @@ Item {
}
}
Text {
Layout.alignment: Qt.AlignHCenter
visible: mainItem.call && mainItem.call != undefined
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
visible: mainItem.displayAll
text: mainItem.call && mainItem.call.core.peerAddress
color: DefaultStyle.grey_0
font {
@ -141,7 +151,7 @@ Item {
: ""
color: DefaultStyle.grey_0
font {
pixelSize: 14 * DefaultStyle.dp
pixelSize: (mainItem.bigBottomAddress ? 14 : 10) * DefaultStyle.dp
weight: 500 * DefaultStyle.dp
}
}
@ -155,4 +165,25 @@ Item {
shadowBlur: 1
shadowOpacity: 0.4
}
RowLayout{
anchors.right: parent.right
anchors.top: parent.top
anchors.rightMargin: 8 * DefaultStyle.dp
anchors.topMargin: 8 * DefaultStyle.dp
height: 18 * DefaultStyle.dp
spacing: 0
CheckableButton {
id: muteIcon
icon.source: AppIcons.microphoneSlash
Layout.preferredWidth: 18 * DefaultStyle.dp
Layout.preferredHeight: 18 * DefaultStyle.dp
visible: mainItem.mutedStatus
icon.width: 13 * DefaultStyle.dp
icon.height: 13 * DefaultStyle.dp
enabled: false
contentImageColor: DefaultStyle.main2_500main
backgroundColor: DefaultStyle.grey_0
}
}
}

View file

@ -41,6 +41,7 @@ Item{
property var address: participantDevice && participantDevice.core.address
videoEnabled: (participantDevice && participantDevice.core.videoEnabled) || (!participantDevice && call && call.core.remoteVideoEnabled)
qmlName: 'AS'
displayPresence: false
Timer {
id: waitingTimer
@ -104,6 +105,8 @@ Item{
qmlName: 'S_'+index
visible: parent.visible
participantDevice: $modelData
displayAll: false
displayPresence: false
Component.onCompleted: console.log(qmlName + " is " +($modelData ? $modelData.core.address : "-"))
}
}
@ -127,6 +130,8 @@ Item{
property AccountProxy accounts: AccountProxy{id: accountProxy}
account: accountProxy.defaultAccount
call: mainItem.call
displayAll: false
displayPresence: false
MovableMouseArea {
id: previewMouseArea

View file

@ -22,6 +22,7 @@ Mosaic {
qmlName: "G"
Component.onCompleted: console.log("Loaded : " +allDevices + " = " +allDevices.count)
}
property AccountProxy accounts: AccountProxy{id: accountProxy}
model: grid.call.core.isConference ? participantDevices: [0,1]
delegate: Item{
id: avatarCell
@ -39,6 +40,10 @@ Mosaic {
anchors.fill: parent
qmlName: 'G_'+index
call: !grid.call.core.isConference ? grid.call : null
account: index == 0 ? accountProxy.defaultAccount : null
displayAll: false
bigBottomAddress: true
displayPresence: false
participantDevice: avatarCell.currentDevice
Component.onCompleted: console.log(qmlName + " is " +(call ? call.core.peerAddress : currentDevice ? currentDevice.core.address : 'addr_NotDefined'))