quickshell: overshoot right edge and add bottom concave ear

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

View file

@ -1182,11 +1182,11 @@ in
anchor.rect.y: bar.height anchor.rect.y: bar.height
anchor.edges: Edges.Top | Edges.Left anchor.edges: Edges.Top | Edges.Left
anchor.gravity: Edges.Bottom | Edges.Right anchor.gravity: Edges.Bottom | Edges.Right
anchor.adjustment: PopupAdjustment.Slide anchor.adjustment: alignRight ? PopupAdjustment.None : PopupAdjustment.Slide
visible: false visible: false
color: "transparent" color: "transparent"
implicitWidth: fullWidth + (alignRight ? 8 : 16) implicitWidth: alignRight ? fullWidth + 8 + 20 : fullWidth + 16
implicitHeight: fullHeight + 4 implicitHeight: alignRight ? fullHeight + 4 + 8 : fullHeight + 4
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
@ -1267,16 +1267,17 @@ in
Rectangle { Rectangle {
id: _dropdownRect id: _dropdownRect
anchors.left: dropdown.alignRight ? undefined : undefined
anchors.right: dropdown.alignRight ? parent.right : undefined anchors.right: dropdown.alignRight ? parent.right : undefined
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.alignRight ? dropdown.fullWidth + 20 : dropdown.fullWidth
height: dropdown.open ? dropdown.fullHeight : 0 height: dropdown.open ? dropdown.fullHeight : 0
color: Theme.barBg color: Theme.barBg
radius: 8 radius: 8
topLeftRadius: 0 topLeftRadius: 0
topRightRadius: 0 topRightRadius: 0
bottomRightRadius: dropdown.alignRight ? 0 : 8 bottomRightRadius: 0
clip: true clip: true
Behavior on height { Behavior on height {
@ -1285,7 +1286,32 @@ in
Item { Item {
id: dropdownContent id: dropdownContent
anchors.fill: parent anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: dropdown.fullWidth
}
}
// Bottom concave ear on right edge
Item {
visible: dropdown.alignRight && _dropdownRect.height > 0
anchors.right: parent.right
y: _dropdownRect.height
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.lineTo(0, 8);
ctx.arc(0, 0, 8, Math.PI / 2, 0, true);
ctx.closePath(); ctx.fill();
}
} }
} }
} }