quickshell: simplify right-edge dropdown flush to screen

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-27 09:55:58 +01:00
parent c2bd45944f
commit 0f51a3fa49

View file

@ -1185,8 +1185,8 @@ in
anchor.adjustment: PopupAdjustment.Slide anchor.adjustment: PopupAdjustment.Slide
visible: false visible: false
color: "transparent" color: "transparent"
implicitWidth: alignRight ? fullWidth + 8 + 8 : fullWidth + 16 implicitWidth: fullWidth + (alignRight ? 8 : 16)
implicitHeight: alignRight ? fullHeight + 4 + 8 : fullHeight + 4 implicitHeight: fullHeight + 4
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
@ -1265,42 +1265,9 @@ 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 { Rectangle {
id: _dropdownRect id: _dropdownRect
anchors.right: dropdown.alignRight ? parent.right : undefined anchors.right: dropdown.alignRight ? parent.right : undefined
anchors.rightMargin: dropdown.alignRight ? 8 : 0
anchors.horizontalCenter: dropdown.alignRight ? undefined : parent.horizontalCenter anchors.horizontalCenter: dropdown.alignRight ? undefined : parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
width: dropdown.fullWidth width: dropdown.fullWidth