diff --git a/modules/corners/ScreenCorners.qml b/modules/corners/ScreenCorners.qml index 8edf429..81d7c59 100644 --- a/modules/corners/ScreenCorners.qml +++ b/modules/corners/ScreenCorners.qml @@ -1,5 +1,6 @@ pragma ComponentBehavior: Bound import QtQuick +import QtQuick.Shapes import Quickshell import Quickshell.Wayland import qs @@ -21,28 +22,20 @@ Item { implicitHeight: Config.rounding color: "transparent" - Canvas { - id: tlCanvas + Shape { anchors.fill: parent - onWidthChanged: requestPaint() - onPaint: { - var ctx = getContext("2d") - var s = width - ctx.clearRect(0, 0, s, s) - var c = Colors.base00 - ctx.fillStyle = Qt.rgba(c.r, c.g, c.b, Config.opacity) - ctx.fillRect(0, 0, s, s) - ctx.globalCompositeOperation = "destination-out" - ctx.beginPath() - ctx.moveTo(s, s) - ctx.arc(s, s, s, Math.PI, 3 * Math.PI / 2, false) - ctx.closePath() - ctx.fill() - ctx.globalCompositeOperation = "source-over" - } - Connections { - target: Config - function onOpacityChanged() { tlCanvas.requestPaint() } + preferredRendererType: Shape.CurveRenderer + ShapePath { + fillColor: Qt.rgba(Colors.base00.r, Colors.base00.g, Colors.base00.b, Config.opacity) + strokeWidth: -1 + startX: 0; startY: 0 + PathLine { x: tlWin.implicitWidth; y: 0 } + PathArc { + x: 0; y: tlWin.implicitHeight + radiusX: tlWin.implicitWidth; radiusY: tlWin.implicitHeight + direction: PathArc.Counterclockwise + } + PathLine { x: 0; y: 0 } } } } @@ -64,29 +57,21 @@ Item { implicitHeight: Config.rounding color: "transparent" - Canvas { - id: trCanvas + Shape { anchors.fill: parent - onWidthChanged: requestPaint() - onPaint: { - var ctx = getContext("2d") - var s = width - ctx.clearRect(0, 0, s, s) - var c = Colors.base00 - ctx.fillStyle = Qt.rgba(c.r, c.g, c.b, Config.opacity) - ctx.fillRect(0, 0, s, s) - // Punch out quarter-circle from inner corner (0, s) - ctx.globalCompositeOperation = "destination-out" - ctx.beginPath() - ctx.moveTo(0, s) - ctx.arc(0, s, s, -Math.PI / 2, 0, false) - ctx.closePath() - ctx.fill() - ctx.globalCompositeOperation = "source-over" - } - Connections { - target: Config - function onOpacityChanged() { trCanvas.requestPaint() } + preferredRendererType: Shape.CurveRenderer + ShapePath { + fillColor: Qt.rgba(Colors.base00.r, Colors.base00.g, Colors.base00.b, Config.opacity) + strokeWidth: -1 + startX: 0; startY: 0 + PathLine { x: trWin.implicitWidth; y: 0 } + PathLine { x: trWin.implicitWidth; y: trWin.implicitHeight } + PathArc { + x: 0; y: 0 + radiusX: trWin.implicitWidth; radiusY: trWin.implicitHeight + direction: PathArc.Counterclockwise + } + PathLine { x: 0; y: 0 } } } } @@ -107,29 +92,20 @@ Item { implicitHeight: Config.rounding color: "transparent" - Canvas { - id: blCanvas + Shape { anchors.fill: parent - onWidthChanged: requestPaint() - onPaint: { - var ctx = getContext("2d") - var s = width - ctx.clearRect(0, 0, s, s) - var c = Colors.base00 - ctx.fillStyle = Qt.rgba(c.r, c.g, c.b, Config.opacity) - ctx.fillRect(0, 0, s, s) - // Punch out quarter-circle from inner corner (s, 0) - ctx.globalCompositeOperation = "destination-out" - ctx.beginPath() - ctx.moveTo(s, 0) - ctx.arc(s, 0, s, Math.PI / 2, Math.PI, false) - ctx.closePath() - ctx.fill() - ctx.globalCompositeOperation = "source-over" - } - Connections { - target: Config - function onOpacityChanged() { blCanvas.requestPaint() } + preferredRendererType: Shape.CurveRenderer + ShapePath { + fillColor: Qt.rgba(Colors.base00.r, Colors.base00.g, Colors.base00.b, Config.opacity) + strokeWidth: -1 + startX: 0; startY: 0 + PathArc { + x: blWin.implicitWidth; y: blWin.implicitHeight + radiusX: blWin.implicitWidth; radiusY: blWin.implicitHeight + direction: PathArc.Counterclockwise + } + PathLine { x: 0; y: blWin.implicitHeight } + PathLine { x: 0; y: 0 } } } } @@ -150,29 +126,20 @@ Item { implicitHeight: Config.rounding color: "transparent" - Canvas { - id: brCanvas + Shape { anchors.fill: parent - onWidthChanged: requestPaint() - onPaint: { - var ctx = getContext("2d") - var s = width - ctx.clearRect(0, 0, s, s) - var c = Colors.base00 - ctx.fillStyle = Qt.rgba(c.r, c.g, c.b, Config.opacity) - ctx.fillRect(0, 0, s, s) - // Punch out quarter-circle from inner corner (0, 0) - ctx.globalCompositeOperation = "destination-out" - ctx.beginPath() - ctx.moveTo(0, 0) - ctx.arc(0, 0, s, 0, Math.PI / 2, false) - ctx.closePath() - ctx.fill() - ctx.globalCompositeOperation = "source-over" - } - Connections { - target: Config - function onOpacityChanged() { brCanvas.requestPaint() } + preferredRendererType: Shape.CurveRenderer + ShapePath { + fillColor: Qt.rgba(Colors.base00.r, Colors.base00.g, Colors.base00.b, Config.opacity) + strokeWidth: -1 + startX: brWin.implicitWidth; startY: brWin.implicitHeight + PathLine { x: 0; y: brWin.implicitHeight } + PathArc { + x: brWin.implicitWidth; y: 0 + radiusX: brWin.implicitWidth; radiusY: brWin.implicitHeight + direction: PathArc.Counterclockwise + } + PathLine { x: brWin.implicitWidth; y: brWin.implicitHeight } } } } diff --git a/modules/notifications/NotiCard.qml b/modules/notifications/NotiCard.qml index 0129860..d809017 100644 --- a/modules/notifications/NotiCard.qml +++ b/modules/notifications/NotiCard.qml @@ -53,7 +53,7 @@ WrapperRectangle { } } ColumnLayout { - spacing: 0 + spacing: 0 StyledText { id: title Layout.bottomMargin: 0 @@ -68,6 +68,7 @@ WrapperRectangle { Layout.alignment: Qt.AlignBottom text: root.notification?.body ? root.notification.body : '' elide: Text.ElideRight + maximumLineCount: 1 Layout.fillWidth: true opacity: 0.6 } diff --git a/settings/settings.ini b/settings/settings.ini index c964bbe..0601bf8 100644 --- a/settings/settings.ini +++ b/settings/settings.ini @@ -2,6 +2,6 @@ barHeight=34 font=Maple Mono fontSize=16 -opacity=1 -roudning=20 -wallpaper=@Variant(\0\0\0\x11\0\0\0)file:///home/lucy/.wall/walkingcastle.png) +opacity=0.5 +roudning=16 +wallpaper=@Variant(\0\0\0\x11\0\0\0!file:///home/lucy/.wall/mooon.png)