tweak popout margins for consistency (#399)

This commit is contained in:
Body authored and GitHub committed 2025-10-13 14:17:02 -04:00
1 parent 3c5a23799f
commit 9b9fbabc3f
3 files changed
+10 -10

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ Singleton {
readonly property bool envDisableMatugen: Quickshell.env("DMS_DISABLE_MATUGEN") === "1" || Quickshell.env("DMS_DISABLE_MATUGEN") === "true"
// ! TODO - Synchronize with niri/hyprland gaps?
readonly property real popupDistance: 2
readonly property real popupDistance: SettingsData.dankBarSpacing
property string currentTheme: "blue"
property string currentThemeCategory: "generic"
+4 -4
View File
@@ -87,9 +87,9 @@ PanelWindow {
readonly property real alignedHeight: Theme.px(popupHeight, dpr)
readonly property real alignedX: Theme.snap((() => {
if (SettingsData.dankBarPosition === SettingsData.Position.Left) {
return triggerY
return triggerY + SettingsData.dankBarBottomGap
} else if (SettingsData.dankBarPosition === SettingsData.Position.Right) {
return screenWidth - triggerY - popupWidth
return screenWidth - triggerY - SettingsData.dankBarBottomGap - popupWidth
} else {
const centerX = triggerX + (triggerWidth / 2) - (popupWidth / 2)
return Math.max(Theme.popupDistance, Math.min(screenWidth - popupWidth - Theme.popupDistance, centerX))
@@ -100,9 +100,9 @@ PanelWindow {
const centerY = triggerX + (triggerWidth / 2) - (popupHeight / 2)
return Math.max(Theme.popupDistance, Math.min(screenHeight - popupHeight - Theme.popupDistance, centerY))
} else if (SettingsData.dankBarPosition === SettingsData.Position.Bottom) {
return Math.max(Theme.popupDistance, Math.min(screenHeight - popupHeight - Theme.popupDistance, screenHeight - triggerY - popupHeight + Theme.popupDistance))
return Math.max(Theme.popupDistance, screenHeight - triggerY - popupHeight)
} else {
return Math.max(Theme.popupDistance, Math.min(screenHeight - popupHeight - Theme.popupDistance, triggerY + Theme.popupDistance))
return Math.min(screenHeight - popupHeight - Theme.popupDistance, triggerY)
}
})(), dpr)
+5 -5
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)))
}
}