From 8c41f454201a63fa0395dcbdbb2794e0ea8b1285 Mon Sep 17 00:00:00 2001 From: Fimeg Date: Mon, 3 Aug 2026 19:15:18 -0400 Subject: [PATCH] shell: the overview swipes sideways, and stops rejecting its own buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../souveraine/navigation/WindowOverview.qml | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/surfaces/quickshell/modules/souveraine/navigation/WindowOverview.qml b/surfaces/quickshell/modules/souveraine/navigation/WindowOverview.qml index 406c8a2..20871e4 100644 --- a/surfaces/quickshell/modules/souveraine/navigation/WindowOverview.qml +++ b/surfaces/quickshell/modules/souveraine/navigation/WindowOverview.qml @@ -63,11 +63,22 @@ Item { anchors.margins: 12 visible: root.count > 0 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 clip: true // Cards are tall; a phone shows one and a bit at a time and flicks - // between them. - cacheBuffer: height * 2 + // between them. Clamped at zero because `height` is -1 until the first + // layout pass and ListView rejects a negative buffer outright. + cacheBuffer: Math.max(0, width * 2) delegate: Item { id: card @@ -132,10 +143,7 @@ Item { } width: list.width - // 16:9 of the card's own width, plus the label strip. The reference - // 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 + height: list.height Rectangle { anchors.fill: parent @@ -153,7 +161,8 @@ Item { anchors.right: parent.right anchors.top: parent.top 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 // a render of that window every frame, and leaving them running // behind a closed overview is the battery cost of drawing