From 9524833e9508f7d0ec16e58e91ef6073f04aa562 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 28 Sep 2022 19:34:31 +0200 Subject: [PATCH] Choose a more homogenized(=compact) layout for mosaic if sizes are equivalent. --- linphone-app/ui/modules/Common/Form/Mosaic.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linphone-app/ui/modules/Common/Form/Mosaic.qml b/linphone-app/ui/modules/Common/Form/Mosaic.qml index 1e4102577..32151bbc5 100644 --- a/linphone-app/ui/modules/Common/Form/Mosaic.qml +++ b/linphone-app/ui/modules/Common/Form/Mosaic.qml @@ -84,7 +84,8 @@ ColumnLayout{ for(var C = itemCount ; C >= 1 ; --C){ if( R * C >= itemCount){// This is a good layout candidate var estimatedSize = Math.min(availableW / C, availableH / R) - if(estimatedSize > bestSize){ + if(estimatedSize > bestSize // Size is better + || (estimatedSize == bestSize && Math.abs(bestR-bestC) > Math.abs(R - C) )){// Stickers are more homogenized bestSize = estimatedSize bestC = C bestR = R