Add max-rows

Scrolling left the overlay's height entirely derived — as many rows as fit
in 90% of the display — so with enough windows it is always nearly
full-height, and there was no way to ask for a compact strip instead.
max-rows caps the viewport and scrolls the rest, which makes it the
symmetric partner to max-columns; rows are also the natural unit when
tiles are a fixed size, where a height in ppt would flip the row count
about as the tile size changes.

Measured on a 1280x1440 display with 14 tiles at 18ppt: uncapped gives a
981px surface showing 3 of 4 rows, max-rows = 2 gives 657px, and 1 gives
333px — each a row's pitch apart.

The test I wrote for it was wrong before the code was: four tiles make a
2x2 grid under the ceil(sqrt(n)) rule, not the 4x1 I had assumed.
This commit is contained in:
Milad Alizadeh
2026-08-31 18:27:11 +01:00
parent 94d8145079
commit 13c0252cef
4 changed files with 43 additions and 7 deletions
+8 -2
View File
@@ -153,6 +153,7 @@ border-width = 2px
tile-width = 18ppt # largest a thumbnail may be
tile-height = 20ppt # defaults to the display's aspect
max-columns = 4
max-rows = 3 # default: however many the display fits
font = monospace
font-size = 13.3
@@ -175,8 +176,13 @@ the width and the height follows the display's aspect, which is roughly the shap
of the windows on it — a 16:9 cell wastes about half its area on a portrait
monitor.
When there are more rows than the display can show, **the grid scrolls**: the
tile size you asked for is honoured and a scrollbar appears in the right margin.
Nothing sets the overlay's height directly: it is as many rows as fit in 90% of
the display, so below that threshold the window hugs the grid. `max-rows` caps it
if you would rather have a compact strip that scrolls sooner than a full-height
overlay — the symmetric partner to `max-columns`.
When there are more rows than can be shown, **the grid scrolls**: the tile size
you asked for is honoured and a scrollbar appears in the right margin.
Any move keeps the selection in view, `PgUp`/`PgDn` jump a screen, and tiles
scrolled out of sight are unmapped — so live capture skips them too, which is
what stops a long list costing bandwidth for pixels nobody sees. Only a tile too