Replace Rectangle mask with Quickshell.Widgets.ClippingRectangle

This commit is contained in:
2026-02-09 16:51:59 -08:00
parent 925b01939c
commit bcbf6c2df7
2 changed files with 9 additions and 74 deletions

View File

@@ -1,4 +1,5 @@
import Quickshell
import Quickshell.Widgets
import Quickshell.Services.Notifications
import QtQuick
import QtQuick.Controls
@@ -14,35 +15,21 @@ Rectangle {
radius: 20
color: "#181818"
Image {
id: notifIcon
visible: false
ClippingRectangle {
antialiasing: true
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: 12
}
radius: 8
width: 40
height: 40
source: notification?.image ?? source
layer.enabled: true
}
Rectangle {
id: iconMask
antialiasing: true
layer.enabled: true
visible: false
anchors.fill: notifIcon
layer.smooth: true
radius: 8
}
MultiEffect {
anchors.fill: notifIcon
source: notifIcon
maskEnabled: true
maskSource: iconMask
maskThresholdMin: 0.5
maskSpreadAtMin: 1
Image {
id: notifIcon
anchors.fill: parent
source: notification?.image ?? source
}
}
Column {
id: notifContent