From 110c090af4d6864efaead4cc025d87d318367190 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 2 Jun 2021 19:42:34 +0300 Subject: [PATCH] fix #74,decrease margins for rounded backgrounds --- .../contents/ui/background/MultiLayered.qml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/containment/package/contents/ui/background/MultiLayered.qml b/containment/package/contents/ui/background/MultiLayered.qml index 0d40499c6..761bb6312 100644 --- a/containment/package/contents/ui/background/MultiLayered.qml +++ b/containment/package/contents/ui/background/MultiLayered.qml @@ -58,7 +58,9 @@ BackgroundProperties{ var solidBackgroundPadding = solidBackground.margins.top; if (root.isVertical) { - return customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); + var expected = customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); + expected = Math.max(0, expected - metrics.margin.length); //! remove from roundness padding the applied margins + return expected; } else { return Math.max(themePadding, solidBackgroundPadding); } @@ -73,7 +75,9 @@ BackgroundProperties{ var solidBackgroundPadding = solidBackground.margins.bottom; if (root.isVertical) { - return customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); + var expected = customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); + expected = Math.max(0, expected - metrics.margin.length); //! remove from roundness padding the applied margins + return expected; } else { return Math.max(themePadding, solidBackgroundPadding); } @@ -89,7 +93,9 @@ BackgroundProperties{ var solidBackgroundPadding = solidBackground.margins.left; if (root.isHorizontal) { - return customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); + var expected = customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); + expected = Math.max(0, expected - metrics.margin.length); //! remove from roundness padding the applied margins + return expected; } else { return Math.max(themePadding, solidBackgroundPadding); } @@ -105,7 +111,9 @@ BackgroundProperties{ var solidBackgroundPadding = solidBackground.margins.right; if (root.isHorizontal) { - return customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); + var expected = customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackgroundPadding); + expected = Math.max(0, expected - metrics.margin.length); //! remove from roundness padding the applied margins + return expected; } else { return Math.max(themePadding, solidBackgroundPadding); }