From 2afc2a7890ab100f4731b25adb69298b9fb96077 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sun, 20 Sep 2026 15:58:26 +0200 Subject: [PATCH] Report the grid's column count on creation, not only on change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `changed columns` fires on a change, and a first evaluation is not one: a grid built after the window had settled at its size never said how wide it was, so Rust placed month headings for the one column it was told about at start-up — every month began a row, and was announced wherever its first cell fell, mid-row included. Opening a collection showed "October 2025" stranded over a row of August. --- ui/dr-ui/ui/library.slint | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/dr-ui/ui/library.slint b/ui/dr-ui/ui/library.slint index 0475cc9..bde934d 100644 --- a/ui/dr-ui/ui/library.slint +++ b/ui/dr-ui/ui/library.slint @@ -1771,6 +1771,13 @@ export component LibraryGrid inherits Rectangle { // Reported out so Rust can place month headings: a heading belongs on a // cell that begins a row, and only the grid knows how wide a row is. changed columns => { root.columns-changed(root.columns); } + // And once on creation. `changed` reports a change, and the first + // evaluation is not one — so a grid built after the window has already + // settled at its size never said how wide it was, and Rust went on + // placing headings for the one column it had been told about at + // start-up. Every month then began a row and was announced wherever + // its first cell fell, mid-row included. + init => { root.columns-changed(root.columns); } property row-count: ceil(root.cells.length / max(1, columns)); // --- while a pinch is happening, and just after -----------------------