fix corners

This commit is contained in:
Damocles 2026-04-12 15:21:13 +02:00
parent 3a6ba994c5
commit a53616523b

View file

@ -3,10 +3,8 @@ import Quickshell
import Quickshell.Wayland
import "." as M
// Empty region = no input area clicks pass through to windows below
// Draws rounded black corners at the edges of each screen.
// Disabled when screenRadius is 0 (the default).
// Disabled when screenRadius is 0.
Item {
id: root
@ -14,20 +12,13 @@ Item {
readonly property int _r: M.Theme.screenRadius
Repeater {
model: root._r > 0 ? [
{ top: true, left: true, right: false, bottom: false, corner: 0 },
{ top: true, left: false, right: true, bottom: false, corner: 1 },
{ top: false, left: true, right: false, bottom: true, corner: 2 },
{ top: false, left: false, right: true, bottom: true, corner: 3 }
] : []
component Corner: PanelWindow {
id: win
delegate: PanelWindow {
id: cornerWindow
required property var modelData
property int corner: 0
screen: root.screen
visible: root._r > 0
color: "transparent"
WlrLayershell.layer: WlrLayer.Overlay
@ -35,11 +26,6 @@ Item {
WlrLayershell.namespace: "nova-corners"
mask: Region {}
anchors.top: cornerWindow.modelData.top
anchors.left: cornerWindow.modelData.left
anchors.right: cornerWindow.modelData.right
anchors.bottom: cornerWindow.modelData.bottom
implicitWidth: root._r
implicitHeight: root._r
@ -52,7 +38,7 @@ Item {
ctx.fillStyle = "black";
ctx.beginPath();
switch (cornerWindow.modelData.corner) {
switch (win.corner) {
case 0: // top-left
ctx.moveTo(0, 0);
ctx.lineTo(r, 0);
@ -83,5 +69,9 @@ Item {
}
}
}
}
Corner { corner: 0; anchors.top: true; anchors.left: true }
Corner { corner: 1; anchors.top: true; anchors.right: true }
Corner { corner: 2; anchors.bottom: true; anchors.left: true }
Corner { corner: 3; anchors.bottom: true; anchors.right: true }
}