From f8e9755b1eb2694621e0c8f949b87ca0ca9b98b2 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 17 May 2026 08:39:09 +0200 Subject: [PATCH] Fix panel spacing and borders --- .../plugins/bar/common/PopupCard.qml | 29 ++++++++++--------- .../plugins/bar/widgets/audioPanel.qml | 8 +++-- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/default/quickshell/omarchy-shell/plugins/bar/common/PopupCard.qml b/default/quickshell/omarchy-shell/plugins/bar/common/PopupCard.qml index 9c2c901a..139343a5 100644 --- a/default/quickshell/omarchy-shell/plugins/bar/common/PopupCard.qml +++ b/default/quickshell/omarchy-shell/plugins/bar/common/PopupCard.qml @@ -9,7 +9,7 @@ PopupWindow { required property Item anchorItem required property QtObject bar property var owner: null - property int margin: 8 + property int margin: 10 property int padding: 14 property int contentWidth: 280 property int contentHeight: 200 @@ -83,28 +83,31 @@ PopupWindow { if (!window) return if (root.centerOnBar) { + var cx = 0; + var cy = 0; if (root.bar.position === "top" || root.bar.position === "bottom") { - localX = window.width / 2 - popupWidth / 2 - localY = root.bar.position === "bottom" ? -popupHeight - root.margin : window.height + root.margin - localX = Math.max(root.margin, Math.min(localX, window.width - popupWidth - root.margin)) + cx = window.width / 2 - popupWidth / 2 + cy = root.bar.position === "bottom" ? -popupHeight - root.margin : window.height + root.margin + cx = Math.max(root.margin, Math.min(cx, window.width - popupWidth - root.margin)) } else { - localX = root.bar.position === "left" ? window.width + root.margin : -popupWidth - root.margin - localY = window.height / 2 - popupHeight / 2 - localY = Math.max(root.margin, Math.min(localY, window.height - popupHeight - root.margin)) + cx = root.bar.position === "left" ? window.width + root.margin : -popupWidth - root.margin + cy = window.height / 2 - popupHeight / 2 + cy = Math.max(root.margin, Math.min(cy, window.height - popupHeight - root.margin)) } - popupAnchor.rect.x = Math.round(localX) - popupAnchor.rect.y = Math.round(localY) + popupAnchor.rect.x = Math.round(cx) + popupAnchor.rect.y = Math.round(cy) return } + var point = window.contentItem.mapFromItem(target, localX, localY) + if (root.bar.position === "top" || root.bar.position === "bottom") { - localX = Math.max(root.margin, Math.min(localX, window.width - popupWidth - root.margin)) + point.x = Math.max(root.margin, Math.min(point.x, window.width - popupWidth - root.margin)) } else { - localY = Math.max(root.margin, Math.min(localY, window.height - popupHeight - root.margin)) + point.y = Math.max(root.margin, Math.min(point.y, window.height - popupHeight - root.margin)) } - var point = window.contentItem.mapFromItem(target, localX, localY) popupAnchor.rect.x = Math.round(point.x) popupAnchor.rect.y = Math.round(point.y) } @@ -115,7 +118,7 @@ PopupWindow { anchors.fill: parent color: Color.popups.background border.color: Color.popups.border - border.width: 1 + border.width: 2 radius: 0 opacity: root.open ? 1.0 : 0 diff --git a/default/quickshell/omarchy-shell/plugins/bar/widgets/audioPanel.qml b/default/quickshell/omarchy-shell/plugins/bar/widgets/audioPanel.qml index 70ef827c..58822b9e 100644 --- a/default/quickshell/omarchy-shell/plugins/bar/widgets/audioPanel.qml +++ b/default/quickshell/omarchy-shell/plugins/bar/widgets/audioPanel.qml @@ -192,7 +192,9 @@ Item { owner: root bar: root.bar open: root.popupOpen - contentWidth: 380 + // Match the width/inset of the window below so the popup outline + // overlays cleanly instead of bleeding past the underlying frame. + contentWidth: 370 contentHeight: Math.min(560, panelColumn.implicitHeight + 28) ScrollView { @@ -296,7 +298,7 @@ Item { width: panelColumn.width height: deviceRow.implicitHeight + 10 - radius: 4 + radius: 0 color: deviceArea.pressed ? Qt.rgba(root.bar.foreground.r, root.bar.foreground.g, root.bar.foreground.b, 0.22) : deviceArea.containsMouse @@ -447,7 +449,7 @@ Item { width: panelColumn.width height: sourceRow.implicitHeight + 10 - radius: 4 + radius: 0 color: sourceArea.pressed ? Qt.rgba(root.bar.foreground.r, root.bar.foreground.g, root.bar.foreground.b, 0.22) : sourceArea.containsMouse