Size the grid by caps, not by tile size

tile-width and tile-height are gone. In their place the config states a
box and a grid, all four settings caps of the same kind:

    max-width   = 90ppt      # the box the grid may fill
    max-height  = 90ppt
    max-columns = 4          # the grid inside it
    max-rows    = 4

A thumbnail is that box divided by those caps. The property that buys is
that a thumbnail's size no longer depends on how many windows are open:
one window gets the same thumbnail as thirty, in a smaller overlay,
because the overlay hugs whatever is actually there. Rows past max-rows
still scroll.

It also removes two things that were hard to explain. tile-height used to
default to the display's aspect through a rule you could only learn from
the documentation — the shape now falls out of the box and the grid.
And ppt meant "of the display width" on one key and "of the display
height" on another; the two remaining lengths take the axis their name
implies.

The 90% fill constant went with them: it was an invisible cap doing the
job max-width now does out loud, and its old value is the default.

Turning labels off now gives that row to the thumbnails rather than
shrinking the window, which follows from the box being what you asked
for. Verified on a 1280x1440 display: 90ppt gives a 1149x1293 overlay,
60ppt gives 765x861, and caps of 2x2 in the same box give larger
thumbnails that scroll after two rows.
This commit is contained in:
Milad Alizadeh
2026-09-06 10:46:15 +01:00
parent 13c0252cef
commit 86319aa309
5 changed files with 173 additions and 178 deletions
+3 -1
View File
@@ -101,7 +101,9 @@ fn run() -> Result<ExitCode, Box<dyn Error>> {
theme.font.clone(),
theme.font_px * scale as f32,
(theme.line_h * scale) as f32,
(layout.label(0, 0).map(|r| r.w).unwrap_or(theme.tile_w) * scale) as f32,
// The label box is a tile wide; with no tiles there is nothing to
// shape anyway.
(layout.label(0, 0).map(|r| r.w).unwrap_or(1) * scale) as f32,
)
});