From 18f1d460bb8b61acfb7d70d1fc0875eb7c06a406 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 11 Sep 2021 13:10:46 +0300 Subject: [PATCH] fix Fitt's Law for justify vertical panels --- .../package/contents/ui/layouts/LayoutsContainer.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/containment/package/contents/ui/layouts/LayoutsContainer.qml b/containment/package/contents/ui/layouts/LayoutsContainer.qml index d6dc0950e..a6f553a30 100644 --- a/containment/package/contents/ui/layouts/LayoutsContainer.qml +++ b/containment/package/contents/ui/layouts/LayoutsContainer.qml @@ -166,7 +166,8 @@ Item{ } else if (root.myView.alignment === LatteCore.Types.Center) { bestMatchingPadding = Math.max(background.paddings.left, minimumPadding) - minimumPadding; } else if (root.myView.alignment === LatteCore.Types.Justify) { - bestMatchingPadding = Math.max(background.paddings.left, minimumPadding) - minimumPadding; + var backpadding = root.isHorizontal ? background.paddings.left : background.paddings.top; + bestMatchingPadding = Math.max(backpadding, minimumPadding) - minimumPadding; } //shadow is already calculated in Justify mode @@ -188,7 +189,8 @@ Item{ } else if (root.myView.alignment === LatteCore.Types.Center) { bestMatchingPadding = Math.max(background.paddings.right, minimumPadding) - minimumPadding; } else if (root.myView.alignment === LatteCore.Types.Justify) { - bestMatchingPadding = Math.max(background.paddings.right, minimumPadding) - minimumPadding; + var backpadding = root.isHorizontal ? background.paddings.right : background.paddings.bottom; + bestMatchingPadding = Math.max(backpadding, minimumPadding) - minimumPadding; } //shadow is already calculated in Justify mode