Watch
1
0
Fork
You've already forked souveraine
0

shell: the overview swipes sideways, and stops rejecting its own buffer

Two faults in the first cut.

cacheBuffer was height * 2, and height is -1 until the first layout
pass, so ListView refused it outright and said so on every open. Clamped
at zero.

The strip was vertical. TASK-14 asks for "horizontally swiped live app
cards" and the reference shell's carousel says the same thing in its own
comment — the whole strip slides in horizontally. On a phone the thumb
travels sideways, and a vertical list fights the flick-up that dismisses
a card, so the two gestures were competing for the same axis. Horizontal
with snap-one-item, cards filling the viewport.
This commit is contained in:
Fimeg 2026-08-03 19:15:18 -04:00
commit 8c41f45420

View file

@ -63,11 +63,22 @@ Item {
anchors.margins: 12 anchors.margins: 12
visible: root.count > 0 visible: root.count > 0
model: root.windows model: root.windows
// Horizontal, per TASK-14 ("horizontally swiped live app cards") and
// per the reference shell's own carousel, whose comment reads "the
// whole strip slides in horizontally". A vertical strip was the first
// draft and it is the wrong axis on a phone: the thumb travels
// sideways, and a vertical list fights the flick-up that dismisses.
orientation: ListView.Horizontal
snapMode: ListView.SnapOneItem
highlightRangeMode: ListView.StrictlyEnforceRange
preferredHighlightBegin: 0
preferredHighlightEnd: width
spacing: 12 spacing: 12
clip: true clip: true
// Cards are tall; a phone shows one and a bit at a time and flicks // Cards are tall; a phone shows one and a bit at a time and flicks
// between them. // between them. Clamped at zero because `height` is -1 until the first
cacheBuffer: height * 2 // layout pass and ListView rejects a negative buffer outright.
cacheBuffer: Math.max(0, width * 2)
delegate: Item { delegate: Item {
id: card id: card
@ -132,10 +143,7 @@ Item {
} }
width: list.width width: list.width
// 16:9 of the card's own width, plus the label strip. The reference height: list.height
// shell reserves 44 for its title; this uses the same idea with the
// shell's own text metrics rather than a copied constant.
height: Math.round(list.width * 0.62) + label.height + 8
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
@ -153,7 +161,8 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.margins: 6 anchors.margins: 6
height: card.height - label.height - 14 anchors.bottom: label.top
anchors.bottomMargin: 6
// Only while the overview is up. A live capture per window is // Only while the overview is up. A live capture per window is
// a render of that window every frame, and leaving them running // a render of that window every frame, and leaving them running
// behind a closed overview is the battery cost of drawing // behind a closed overview is the battery cost of drawing