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.edges: Edges.Top | Edges.Left
anchor.gravity: Edges.Bottom | Edges.Right anchor.gravity: Edges.Bottom | Edges.Right
implicitWidth: 386 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 visible: service.toasts.length > 0
grabFocus: false grabFocus: false
color: "transparent" color: "transparent"
Column { // CONTRACT: la partie transparente ne capte pas les clics du bureau.
id: stack mask: Region { item: viewport }
Flickable {
id: viewport
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.margins: 8 anchors.margins: 8
spacing: 7 height: Math.min(area.height - 16, contentHeight)
Repeater { contentWidth: width
model: area.service.toasts.slice(-4).reverse() contentHeight: stack.childrenRect.height
delegate: NotificationToast { clip: true
required property var modelData interactive: contentHeight > height
entry: modelData boundsBehavior: Flickable.StopAtBounds
service: area.service Column {
width: stack.width 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
}
} }
} }
} }