Report the grid's column count on creation, not only on change
`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.
This commit is contained in:
@@ -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 <int> row-count: ceil(root.cells.length / max(1, columns));
|
||||
|
||||
// --- while a pinch is happening, and just after -----------------------
|
||||
|
||||
Reference in New Issue
Block a user