fix(notifications): keep toast surface geometry stable

This commit is contained in:
fy59 2026-10-04 20:07:19 +02:00
parent e1efd1881c
commit aa140b0de5

View file

@ -15,24 +15,40 @@ PopupWindow {
anchor.edges: Edges.Top | Edges.Left
anchor.gravity: Edges.Bottom | Edges.Right
implicitWidth: 386
implicitHeight: Math.min(550, stack.implicitHeight + 16)
// WHY: redimensionner un popup Wayland déjà visible peut présenter un
// ancien buffer étiré pendant que Qt recalcule les cartes. La surface
// garde sa taille ; seule la pile interne suit les notifications.
// INVARIANT: hauteur native indépendante des arrivées et expirations.
implicitHeight: 550
visible: service.toasts.length > 0
grabFocus: false
color: "transparent"
Column {
id: stack
// CONTRACT: la partie transparente ne capte pas les clics du bureau.
mask: Region { item: viewport }
Flickable {
id: viewport
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 8
spacing: 7
Repeater {
model: area.service.toasts.slice(-4).reverse()
delegate: NotificationToast {
required property var modelData
entry: modelData
service: area.service
width: stack.width
height: Math.min(area.height - 16, contentHeight)
contentWidth: width
contentHeight: stack.childrenRect.height
clip: true
interactive: contentHeight > height
boundsBehavior: Flickable.StopAtBounds
Column {
id: stack
width: viewport.width
spacing: 7
Repeater {
model: area.service.toasts.slice(-4).reverse()
delegate: NotificationToast {
required property var modelData
entry: modelData
service: area.service
width: stack.width
}
}
}
}