From a75f8c23560b4be961134275de99fd8ae643178b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= Date: Fri, 15 Apr 2022 10:15:28 -0400 Subject: [PATCH] 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 --- src/mainview/components/ParticipantsLayer.qml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mainview/components/ParticipantsLayer.qml b/src/mainview/components/ParticipantsLayer.qml index 23d38512..e4887476 100644 --- a/src/mainview/components/ParticipantsLayer.qml +++ b/src/mainview/components/ParticipantsLayer.qml @@ -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 {