Document centered_rect layout helpers

This commit is contained in:
2026-06-01 16:41:25 +02:00
parent e9a466b250
commit 20a752f2e7
+3
View File
@@ -274,6 +274,8 @@ pub fn draw_ok_dialog_styled(f: &mut Frame, app: &AppState, title: &str, lines:
draw_whale_separator(f, bar, app);
}
/// Return a rectangle centered in `r` by the given width and height percentages.
/// Shrink a rectangle to the given absolute width and height, centered.
/// Return a rectangle centered in `r` by the given width and height percentages.
fn centered_rect_size(w: u16, h: u16, r: Rect) -> Rect {
let popup = Layout::default().direction(Direction::Vertical)
@@ -645,6 +647,7 @@ fn truncate_path_tail(path: &str, max_width: usize) -> String {
/// Create a centered rectangle for modal overlays.
/// Return a rectangle centered in `r` by the given width and height percentages.
/// Return a rectangle centered in `r` by the given width and height percentages.
fn centered_rect(percent_x: u16, percent_y: u16, r: Rect) -> Rect {
let popup_layout = Layout::default()
.direction(Direction::Vertical)