Clamp single tiled window height
Browse files at this commit6cb5135f3477e63ed1738e19ba95a07ce52093aeParent: 44bf4571 changed file +5 -8
- src/layout/scrolling.rs +5 -8
src/layout/scrolling.rsmodified+5 -8
| @@ -3553,8 +3553,7 @@ impl<W: LayoutElement> Column<W> { | |||
| 3553 | } | 3553 | } |
| 3554 | }; | 3554 | }; |
| 3555 | 3555 | ||
| 3556 | - // If there are multiple windows in a column, clamp the height according to other windows' | 3556 | + // Clamp the height according to other windows' min sizes, or simply to working area height. |
| 3557 | - // min sizes. | ||
| 3558 | let min_height_taken = self | 3557 | let min_height_taken = self |
| 3559 | .tiles | 3558 | .tiles |
| 3560 | .iter() | 3559 | .iter() |
| @@ -3562,12 +3561,10 @@ impl<W: LayoutElement> Column<W> { | |||
| 3562 | .filter(|(idx, _)| *idx != tile_idx) | 3561 | .filter(|(idx, _)| *idx != tile_idx) |
| 3563 | .map(|(_, tile)| f64::max(1., tile.min_size().h) + self.options.gaps) | 3562 | .map(|(_, tile)| f64::max(1., tile.min_size().h) + self.options.gaps) |
| 3564 | .sum::<f64>(); | 3563 | .sum::<f64>(); |
| 3565 | - if min_height_taken > 0. { | 3564 | + let height_left = |
| 3566 | - let height_left = | 3565 | + self.working_area.size.h - self.options.gaps - min_height_taken - self.options.gaps; |
| 3567 | - self.working_area.size.h - self.options.gaps - min_height_taken - self.options.gaps; | 3566 | + let height_left = f64::max(1., tile.window_height_for_tile_height(height_left)); |
| 3568 | - let height_left = f64::max(1., tile.window_height_for_tile_height(height_left)); | 3567 | + window_height = f64::min(height_left, window_height); |
| 3569 | - window_height = f64::min(height_left, window_height); | ||
| 3570 | - } | ||
| 3571 | 3568 | ||
| 3572 | // Clamp it against the window height constraints. | 3569 | // Clamp it against the window height constraints. |
| 3573 | let win = &self.tiles[tile_idx].window(); | 3570 | let win = &self.tiles[tile_idx].window(); |