quickshell: wrap concave corners in clipping Items
Canvas at fixed 8x8 inside a clip Item that grows with calContent.height — corners reveal progressively with the slide animation instead of breaking on dynamic resize. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
36b02fb888
commit
3d79c226ed
1 changed files with 37 additions and 33 deletions
|
|
@ -856,21 +856,22 @@ in
|
||||||
}
|
}
|
||||||
|
|
||||||
// Concave corner — left
|
// Concave corner — left
|
||||||
Canvas {
|
Item {
|
||||||
id: cornerLeft
|
|
||||||
anchors.right: calContent.left
|
anchors.right: calContent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
width: 8
|
width: 8
|
||||||
height: Math.min(8, calContent.height)
|
height: Math.min(8, calContent.height)
|
||||||
visible: calContent.height > 0
|
|
||||||
clip: true
|
clip: true
|
||||||
|
visible: calContent.height > 0
|
||||||
|
Canvas {
|
||||||
|
anchors.top: parent.top
|
||||||
|
width: 8
|
||||||
|
height: 8
|
||||||
onPaint: {
|
onPaint: {
|
||||||
var ctx = getContext("2d");
|
var ctx = getContext("2d");
|
||||||
var r = width;
|
var r = 8;
|
||||||
ctx.clearRect(0, 0, width, height);
|
ctx.clearRect(0, 0, r, r);
|
||||||
ctx.fillStyle = "#D1${c.base00}";
|
ctx.fillStyle = "#D1${c.base00}";
|
||||||
// Concave: filled at top+right, empty curve at bottom-left
|
|
||||||
// Arc centered at bottom-left (0, r)
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(0, 0);
|
ctx.moveTo(0, 0);
|
||||||
ctx.lineTo(r, 0);
|
ctx.lineTo(r, 0);
|
||||||
|
|
@ -880,23 +881,25 @@ in
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Concave corner — right
|
// Concave corner — right
|
||||||
Canvas {
|
Item {
|
||||||
id: cornerRight
|
|
||||||
anchors.left: calContent.right
|
anchors.left: calContent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
width: 8
|
width: 8
|
||||||
height: Math.min(8, calContent.height)
|
height: Math.min(8, calContent.height)
|
||||||
visible: calContent.height > 0
|
|
||||||
clip: true
|
clip: true
|
||||||
|
visible: calContent.height > 0
|
||||||
|
Canvas {
|
||||||
|
anchors.top: parent.top
|
||||||
|
width: 8
|
||||||
|
height: 8
|
||||||
onPaint: {
|
onPaint: {
|
||||||
var ctx = getContext("2d");
|
var ctx = getContext("2d");
|
||||||
var r = width;
|
var r = 8;
|
||||||
ctx.clearRect(0, 0, width, height);
|
ctx.clearRect(0, 0, r, r);
|
||||||
ctx.fillStyle = "#D1${c.base00}";
|
ctx.fillStyle = "#D1${c.base00}";
|
||||||
// Concave: filled at top+left, empty curve at bottom-right
|
|
||||||
// Arc centered at bottom-right (r, r)
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(0, 0);
|
ctx.moveTo(0, 0);
|
||||||
ctx.lineTo(r, 0);
|
ctx.lineTo(r, 0);
|
||||||
|
|
@ -905,6 +908,7 @@ in
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: calContent
|
id: calContent
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue