From c2bd45944f524bc2b686a6e6e20d941b40cd2a1d Mon Sep 17 00:00:00 2001 From: rope Date: Wed, 27 May 2026 09:53:58 +0100 Subject: [PATCH] quickshell: right-edge dropdowns with concave curve to screen edge Co-Authored-By: Claude Opus 4.6 --- settings/hyprland.nix | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 5f8acad..75728bc 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -1185,8 +1185,8 @@ in anchor.adjustment: PopupAdjustment.Slide visible: false color: "transparent" - implicitWidth: alignRight ? fullWidth + 8 : fullWidth + 16 - implicitHeight: fullHeight + 4 + implicitWidth: alignRight ? fullWidth + 8 + 8 : fullWidth + 16 + implicitHeight: alignRight ? fullHeight + 4 + 8 : fullHeight + 4 onVisibleChanged: { if (visible) { @@ -1242,7 +1242,7 @@ in } } - // Right ear (hidden when aligned right — edge takes over) + // Right ear (for centered dropdowns) Item { anchors.left: _dropdownRect.right anchors.top: parent.top @@ -1265,9 +1265,42 @@ in } } + // Right-edge strip — fills from dropdown to screen edge + Rectangle { + visible: dropdown.alignRight + anchors.left: _dropdownRect.right + anchors.top: parent.top + anchors.right: parent.right + height: _dropdownRect.height + color: Theme.barBg + } + + // Right-edge bottom ear — concave curve at bottom of right edge strip + Item { + visible: dropdown.alignRight && _dropdownRect.height > 0 + anchors.right: parent.right + anchors.top: _dropdownRect.bottom + width: 8 + height: 8 + clip: true + Canvas { + width: 8; height: 8 + onPaint: { + var ctx = getContext("2d"); + ctx.clearRect(0, 0, 8, 8); + ctx.fillStyle = Theme.barBg; + ctx.beginPath(); + ctx.moveTo(8, 0); ctx.lineTo(8, 8); + ctx.arc(0, 0, 8, 0, Math.PI / 2, false); + ctx.closePath(); ctx.fill(); + } + } + } + Rectangle { id: _dropdownRect anchors.right: dropdown.alignRight ? parent.right : undefined + anchors.rightMargin: dropdown.alignRight ? 8 : 0 anchors.horizontalCenter: dropdown.alignRight ? undefined : parent.horizontalCenter anchors.top: parent.top width: dropdown.fullWidth @@ -1275,7 +1308,7 @@ in color: Theme.barBg radius: 8 topLeftRadius: 0 - topRightRadius: dropdown.alignRight ? 0 : 0 + topRightRadius: 0 bottomRightRadius: dropdown.alignRight ? 0 : 8 clip: true