1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-12 18:55:39 +02:00

video-split: follow up fixes

+ Only load participant's avatar when showed
+ Fix some anchors problems
+ Close popup when adding a new member
+ ParticipantsLayer: make SplitView resizable
+ Better flow

Change-Id: Ied2ac6a64df0ae929effc965d24e08c04b71c288
GitLab: #476
This commit is contained in:
Sébastien Blin 2022-03-24 11:22:42 -04:00
parent 5804078157
commit 8d88d189a1
5 changed files with 26 additions and 18 deletions

View file

@ -385,7 +385,6 @@ Rectangle {
CallStackView { CallStackView {
id: callStackView id: callStackView
anchors.fill: parent
visible: false visible: false
objectName: "callStackViewObject" objectName: "callStackViewObject"
} }

View file

@ -41,8 +41,6 @@ Rectangle {
OngoingPageStack OngoingPageStack
} }
anchors.fill: parent
Shortcut { Shortcut {
sequence: "Ctrl+D" sequence: "Ctrl+D"
context: Qt.ApplicationShortcut context: Qt.ApplicationShortcut
@ -150,7 +148,6 @@ Rectangle {
OngoingCallPage { OngoingCallPage {
id: ongoingCallPage id: ongoingCallPage
anchors.fill: parent
property int stackNumber: CallStackView.OngoingPageStack property int stackNumber: CallStackView.OngoingPageStack
isAudioOnly: root.isAudioOnly isAudioOnly: root.isAudioOnly
@ -161,7 +158,6 @@ Rectangle {
InitialCallPage { InitialCallPage {
id: initialCallPage id: initialCallPage
anchors.fill: parent
property int stackNumber: CallStackView.InitialPageStack property int stackNumber: CallStackView.InitialPageStack
isAudioOnly: root.isAudioOnly isAudioOnly: root.isAudioOnly

View file

@ -26,7 +26,13 @@ import net.jami.Constants 1.1
import "../../commoncomponents" import "../../commoncomponents"
ItemDelegate { ItemDelegate {
id: contactPickerItemDelegate id: root
width: ListView.view.width
height: Math.max(
contactPickerContactName.height + textMetricsContactPickerContactId.height + 10,
avatar.height + 10
)
property var showPresenceIndicator: false property var showPresenceIndicator: false
@ -44,7 +50,7 @@ ItemDelegate {
imageId: UID imageId: UID
showPresenceIndicator: contactPickerItemDelegate.showPresenceIndicator && Presence showPresenceIndicator: root.showPresenceIndicator && Presence
} }
Rectangle { Rectangle {
@ -92,7 +98,7 @@ ItemDelegate {
font: contactPickerContactId.font font: contactPickerContactId.font
elide: Text.ElideMiddle elide: Text.ElideMiddle
elideWidth: contactPickerContactInfoRect.width elideWidth: contactPickerContactInfoRect.width
text: BestId == Title ? "" : BestId text: !BestId || BestId == Title ? "" : BestId
} }
text: textMetricsContactPickerContactId.elidedText text: textMetricsContactPickerContactId.elidedText
@ -105,12 +111,6 @@ ItemDelegate {
color: JamiTheme.backgroundColor color: JamiTheme.backgroundColor
implicitWidth: root.width
implicitHeight: Math.max(
contactPickerContactName.height
+ textMetricsContactPickerContactId.height + 10,
avatar.height + 10)
border.width: 0 border.width: 0
} }

View file

@ -101,9 +101,16 @@ Item {
property real size: Math.floor((componentSize + step - 1) / step) * step property real size: Math.floor((componentSize + step - 1) / step) * step
sourceSize: Qt.size(size, size) sourceSize: Qt.size(size, size)
mode: root.isMe ? Avatar.Mode.Account : Avatar.Mode.Contact mode: root.isMe ? Avatar.Mode.Account : Avatar.Mode.Contact
imageId: root.isMe ? LRCInstance.currentAccountId : root.uri
showPresenceIndicator: false showPresenceIndicator: false
visible: root.videoMuted visible: root.videoMuted
onVisibleChanged: {
// Only request avatars when visibility changes (and once)
// This avoid to request images for non showed participants
if (visible && !imageId) {
imageId = root.isMe ? LRCInstance.currentAccountId : root.uri
}
}
} }
overlayItems: Rectangle { overlayItems: Rectangle {

View file

@ -99,8 +99,8 @@ Item {
id: genericParticipantsRect id: genericParticipantsRect
SplitView.preferredHeight: (parent.height / 4) SplitView.preferredHeight: (parent.height / 4)
SplitView.minimumHeight: parent.height / 4 SplitView.minimumHeight: parent.height / 6
SplitView.maximumHeight: inLine? parent.height / 4 : parent.height SplitView.maximumHeight: inLine? parent.height / 2 : parent.height
visible: inLine || CallParticipantsModel.conferenceLayout === CallParticipantsModel.GRID visible: inLine || CallParticipantsModel.conferenceLayout === CallParticipantsModel.GRID
color: "transparent" color: "transparent"
@ -176,7 +176,13 @@ Item {
anchors.fill: parent anchors.fill: parent
spacing: 1 spacing: 1
property int columns: inLine ? commonParticipants.count : Math.max(1, Math.ceil(Math.sqrt(commonParticipants.count))) property int columns: {
if (inLine)
return commonParticipants.count
var ratio = Math.floor(root.width / root.height)
var sqrt = Math.max(1, Math.ceil(Math.sqrt(commonParticipants.count)))
return Math.max(1, Math.round(sqrt * ratio))
}
property int rows: Math.max(1, Math.ceil(commonParticipants.count/columns)) property int rows: Math.max(1, Math.ceil(commonParticipants.count/columns))
property int componentWidth: inLine ? height : Math.floor(genericParticipantsRect.width / commonParticipantsFlow.columns) - 1 property int componentWidth: inLine ? height : Math.floor(genericParticipantsRect.width / commonParticipantsFlow.columns) - 1