mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
tweak popout margins for consistency (#399)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user