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,16 +15,31 @@ 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
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 spacing: 7
Repeater { Repeater {
model: area.service.toasts.slice(-4).reverse() model: area.service.toasts.slice(-4).reverse()
@ -37,3 +52,4 @@ PopupWindow {
} }
} }
} }
}