1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 15:32:50 -05:00

tweak popout margins for consistency (#399)

This commit is contained in:
Body
2025-10-13 19:17:02 +01:00
committed by GitHub
parent 3c5a23799f
commit 9b9fbabc3f
3 changed files with 10 additions and 10 deletions

View File

@@ -48,13 +48,13 @@ PanelWindow {
margins {
left: {
if (alignLeft) return Math.round(targetX)
if (alignRight) return Math.round(targetX - implicitWidth)
return Math.round(targetX - implicitWidth / 2)
if (alignLeft) return Math.round(Math.max(Theme.spacingS, Math.min((targetScreen?.width ?? Screen.width) - implicitWidth - Theme.spacingS, targetX)))
if (alignRight) return Math.round(Math.max(Theme.spacingS, Math.min((targetScreen?.width ?? Screen.width) - implicitWidth - Theme.spacingS, targetX - implicitWidth)))
return Math.round(Math.max(Theme.spacingS, Math.min((targetScreen?.width ?? Screen.width) - implicitWidth - Theme.spacingS, targetX - implicitWidth / 2)))
}
top: {
if (alignLeft || alignRight) return Math.round(targetY - implicitHeight / 2)
return Math.round(targetY)
if (alignLeft || alignRight) return Math.round(Math.max(Theme.spacingS, Math.min((targetScreen?.height ?? Screen.height) - implicitHeight - Theme.spacingS, targetY - implicitHeight / 2)))
return Math.round(Math.max(Theme.spacingS, Math.min((targetScreen?.height ?? Screen.height) - implicitHeight - Theme.spacingS, targetY)))
}
}