Repository navigation
Conversation
3a1978b to
a5f27a5
Compare
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the diff: the printer list grows with the window before it scrolls (#4399). A new function printer_list_height(window, min) returns (window * 0.6).max(min) ("three fifths of the window, and never less than min, egui's default, about six rows") and the combo box takes .height(list) computed from ui.ctx().content_rect().height() and ui.spacing().combo_height. A tall window shows more printers without scrolling, a small one keeps egui's default, and a pure function that is easy to test is the right structure. Checks: .max(min) on a NaN window height returns min (f32::max ignores NaN), so a zero-size or not yet laid out window is safe; the function should have a unit test with a small and a large window, which I did not see in the hunks I fetched. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
Fixes #4399
What this changes
The printer list in the Print dialog only showed about 6 printers before you had to scroll. It can now grow to three fifths of the window, so in a normal-sized window it shows about 17. A short list still fits its rows, and a tiny window keeps the old height.
How I tested it
cargo fmt --checkand clippy with-D warningsare cleanSummary by CodeRabbit