1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-08-21 13:49:29 +03:00

calculate properly custom radius padding

This commit is contained in:
Michail Vourlakos
2021-05-03 04:08:34 +03:00
parent 4bfe48e917
commit e7e593c42b

View File

@ -68,7 +68,7 @@ BackgroundProperties{
paddings.top: {
if (hasTopBorder) {
var themePadding = themeExtendedBackground ? themeExtendedBackground.paddingTop : 0;
var customAppliedRadius = customRadiusIsEnabled && root.isVertical ? 0.8 * customRadius : 0;
var customAppliedRadius = customRadiusIsEnabled && root.isVertical ? 1.0 * customRadius : 0;
return customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackground.margins.top);
}
@ -77,7 +77,7 @@ BackgroundProperties{
paddings.bottom: {
if (hasBottomBorder) {
var themePadding = themeExtendedBackground ? themeExtendedBackground.paddingBottom : 0;
var customAppliedRadius = customRadiusIsEnabled && root.isVertical ? 0.8 * customRadius : 0;
var customAppliedRadius = customRadiusIsEnabled && root.isVertical ? 1.0 * customRadius : 0;
return customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackground.margins.bottom);
}
@ -87,7 +87,7 @@ BackgroundProperties{
paddings.left: {
if (hasLeftBorder) {
var themePadding = themeExtendedBackground ? themeExtendedBackground.paddingLeft : 0;
var customAppliedRadius = customRadiusIsEnabled && root.isHorizontal ? 0.8 * customRadius : 0;
var customAppliedRadius = customRadiusIsEnabled && root.isHorizontal ? 1.0 * customRadius : 0;
return customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackground.margins.left);
}
@ -97,7 +97,7 @@ BackgroundProperties{
paddings.right: {
if (hasRightBorder) {
var themePadding= themeExtendedBackground ? themeExtendedBackground.paddingRight : 0;
var customAppliedRadius = customRadiusIsEnabled && root.isHorizontal ? 0.8 * customRadius : 0;
var customAppliedRadius = customRadiusIsEnabled && root.isHorizontal ? 1.0 * customRadius : 0;
return customRadiusIsEnabled ? customAppliedRadius : Math.max(themePadding, solidBackground.margins.right);
}