1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-07-24 17:35:43 +02:00

ParticipantsLayer: make participants in line more flexibles

All cards where a square when using layout with One big and smalls
This can be improved and be more flexible.

Change-Id: I87868480496289566714ddbe22a5bce31f387dcb
This commit is contained in:
Sébastien Blin 2022-04-15 10:15:28 -04:00
parent 68e8ad46aa
commit a75f8c2356

View file

@ -174,10 +174,13 @@ Item {
}
property int rows: Math.max(1, Math.ceil(commonParticipants.count/columns))
property int componentWidth: {
if (inLine)
return height
var totalSpacing = commonParticipantsFlow.spacing * commonParticipantsFlow.columns
return Math.floor((commonParticipantsFlow.width - totalSpacing)/ commonParticipantsFlow.columns)
var w = Math.floor((commonParticipantsFlow.width - totalSpacing)/ commonParticipantsFlow.columns)
if (inLine) {
w = Math.max(w, height)
w = Math.min(w, height * 4 / 3) // Avoid to wide elements
}
return w
}
Repeater {