Compare commits

...

2 commits

Author SHA1 Message Date
Damocles
27e1f63691 gradient bar: opaque base00 backing behind stroke 2026-04-12 19:32:15 +02:00
Damocles
22c8287315 inset bar contents to avoid overlap with screen corner curve 2026-04-12 19:31:00 +02:00

View file

@ -42,6 +42,22 @@ PanelWindow {
ctx.clearRect(0, 0, w, height); ctx.clearRect(0, 0, w, height);
// Opaque backing behind the stroke so it's not transparent
ctx.fillStyle = M.Theme.base00.toString();
ctx.beginPath();
if (r > lw) {
ctx.moveTo(0, r);
ctx.arc(r, r, r, Math.PI, -Math.PI / 2);
ctx.lineTo(w - r, 0);
ctx.arc(w - r, r, r, -Math.PI / 2, 0);
ctx.lineTo(w, lw);
ctx.lineTo(0, lw);
} else {
ctx.rect(0, 0, w, lw);
}
ctx.fill();
// Gradient stroke
const grad = ctx.createLinearGradient(0, 0, w, 0); const grad = ctx.createLinearGradient(0, 0, w, 0);
grad.addColorStop(0, M.Theme.base0C.toString()); grad.addColorStop(0, M.Theme.base0C.toString());
grad.addColorStop(1, M.Theme.base09.toString()); grad.addColorStop(1, M.Theme.base09.toString());
@ -64,8 +80,8 @@ PanelWindow {
Item { Item {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: M.Theme.barPadding anchors.leftMargin: Math.max(M.Theme.barPadding, M.Theme.screenRadius)
anchors.rightMargin: M.Theme.barPadding anchors.rightMargin: Math.max(M.Theme.barPadding, M.Theme.screenRadius)
// ---- center (declared first so left/right can anchor to it) ---- // ---- center (declared first so left/right can anchor to it) ----
RowLayout { RowLayout {