quickshell: fix bar border gap, ear spike on close, toast border

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-27 16:08:13 +01:00
parent d472ab3444
commit cb3716a1ec

View file

@ -655,12 +655,8 @@ in
Rectangle {
id: barBorderLeft
x: 0; y: 30
width: {
if (!activeDropdown || activeDropdown.dropdownHeight <= 0) return bar.width;
if (activeDropdown.alignRight)
return activeDropdown.x + activeDropdown.width - activeDropdown.fullWidth - 8;
return activeDropdown.x + 8;
}
width: (!activeDropdown || activeDropdown.dropdownHeight <= 0)
? bar.width : activeDropdown.x
height: 1
color: Theme.base03
}
@ -669,7 +665,7 @@ in
Rectangle {
id: barBorderRight
visible: activeDropdown && activeDropdown.dropdownHeight > 0 && !activeDropdown.alignRight
x: activeDropdown ? activeDropdown.x + 8 + activeDropdown.fullWidth : 0
x: activeDropdown ? activeDropdown.x + activeDropdown.width : 0
y: 30
width: activeDropdown ? bar.width - x : 0
height: 1
@ -1277,7 +1273,7 @@ in
width: 8
height: Math.min(8, _dropdownRect.height)
clip: true
visible: _dropdownRect.height > 0
visible: _dropdownRect.height >= 8
Canvas {
anchors.top: parent.top
width: 8; height: 8
@ -1306,7 +1302,7 @@ in
width: 8
height: Math.min(8, _dropdownRect.height)
clip: true
visible: _dropdownRect.height > 0 && !dropdown.alignRight
visible: _dropdownRect.height >= 8 && !dropdown.alignRight
Canvas {
anchors.top: parent.top
width: 8; height: 8
@ -1389,7 +1385,7 @@ in
// Bottom-right concave ear connects dropdown bottom to right screen edge
Item {
visible: dropdown.alignRight && _dropdownRect.height > 0
visible: dropdown.alignRight && _dropdownRect.height >= 8
anchors.right: _dropdownRect.right
anchors.top: _dropdownRect.bottom
width: 8
@ -2275,7 +2271,7 @@ in
width: 8
height: Math.min(8, _toastRect.height)
clip: true
visible: _toastRect.height > 0
visible: _toastRect.height >= 8
Canvas {
anchors.top: parent.top
width: 8; height: 8
@ -2287,6 +2283,11 @@ in
ctx.moveTo(0, 0); ctx.lineTo(8, 0); ctx.lineTo(8, 8);
ctx.arc(0, 8, 8, 0, -Math.PI / 2, true);
ctx.closePath(); ctx.fill();
ctx.strokeStyle = Theme.base03;
ctx.lineWidth = 1;
ctx.beginPath();
ctx.arc(0, 8, 8, 0, -Math.PI / 2, true);
ctx.stroke();
}
}
}
@ -2298,7 +2299,7 @@ in
width: 8
height: Math.min(8, _toastRect.height)
clip: true
visible: _toastRect.height > 0
visible: _toastRect.height >= 8
Canvas {
anchors.top: parent.top
width: 8; height: 8
@ -2310,6 +2311,11 @@ in
ctx.moveTo(0, 0); ctx.lineTo(8, 0);
ctx.arc(8, 8, 8, -Math.PI / 2, Math.PI, true);
ctx.closePath(); ctx.fill();
ctx.strokeStyle = Theme.base03;
ctx.lineWidth = 1;
ctx.beginPath();
ctx.arc(8, 8, 8, -Math.PI / 2, Math.PI, true);
ctx.stroke();
}
}
}
@ -2326,6 +2332,29 @@ in
topRightRadius: 0
clip: true
// Border outline (sides + bottom with rounded corners)
Canvas {
anchors.fill: parent
onPaint: {
var ctx = getContext("2d");
var w = width, h = height, r = 8;
ctx.clearRect(0, 0, w, h);
if (h < 1) return;
ctx.strokeStyle = Theme.base03;
ctx.lineWidth = 1;
ctx.beginPath();
ctx.moveTo(0.5, r);
ctx.lineTo(0.5, h - r);
ctx.arc(r + 0.5, h - r - 0.5, r, Math.PI, Math.PI / 2, true);
ctx.lineTo(w - r - 0.5, h - 0.5);
ctx.arc(w - r - 0.5, h - r - 0.5, r, Math.PI / 2, 0, true);
ctx.lineTo(w - 0.5, r);
ctx.stroke();
}
onWidthChanged: requestPaint()
onHeightChanged: requestPaint()
}
Behavior on height {
NumberAnimation { duration: 220; easing.type: Easing.OutCubic }
}