quickshell: toast notification sits in a base02 card to match the calendar

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-06-13 19:36:11 +01:00
parent faa345d016
commit ad70441589

View file

@ -2663,37 +2663,50 @@ in
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
width: 320 width: 320
height: toastItem.toastOpen ? toastCol.height + 16 : 0 height: toastItem.toastOpen ? toastCard.height + 12 : 0
clip: true clip: true
Behavior on height { Behavior on height {
NumberAnimation { duration: Theme.animMorph; easing.type: Easing.OutExpo } NumberAnimation { duration: Theme.animMorph; easing.type: Easing.OutExpo }
} }
NotifContent { // Notification sits in a base02 rounded card, matching
id: toastCol // the calendar list. Inset 6px so the melt panel frames it.
notif: toastItem.currentNotif Rectangle {
id: toastCard
anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: toastDismiss.left
anchors.top: parent.top
anchors.margins: 8
onActionInvoked: toastItem.dismiss()
}
SIcon {
id: toastDismiss
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.margins: 6
anchors.margins: 8 height: toastCol.height + 16
text: "close" radius: Theme.radiusSmall
color: toastDismissMa.containsMouse ? Theme.base05 : Theme.base03 color: Theme.base02
font.pixelSize: 15
MouseArea { NotifContent {
id: toastDismissMa id: toastCol
anchors.fill: parent notif: toastItem.currentNotif
hoverEnabled: true anchors.left: parent.left
cursorShape: Qt.PointingHandCursor anchors.right: toastDismiss.left
onClicked: { toastItem.currentNotif.dismiss(); toastItem.dismiss(); } anchors.top: parent.top
anchors.margins: 8
onActionInvoked: toastItem.dismiss()
}
SIcon {
id: toastDismiss
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 8
text: "close"
color: toastDismissMa.containsMouse ? Theme.base05 : Theme.base03
font.pixelSize: 15
MouseArea {
id: toastDismissMa
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: { toastItem.currentNotif.dismiss(); toastItem.dismiss(); }
}
} }
} }
} }