(area: Rect, width: u16, height: u16)
| 17 | } |
| 18 | |
| 19 | pub fn centered(area: Rect, width: u16, height: u16) -> Rect { |
| 20 | let popup_layout = Layout::default() |
| 21 | .direction(Direction::Vertical) |
| 22 | .constraints([ |
| 23 | Constraint::Percentage((100 - height as u16) / 2), |
| 24 | Constraint::Length(height), |
| 25 | Constraint::Percentage((100 - height as u16) / 2), |
| 26 | ]) |
| 27 | .split(area); |
| 28 | |
| 29 | Layout::default() |
| 30 | .direction(Direction::Horizontal) |
| 31 | .constraints([ |
| 32 | Constraint::Percentage((100 - width as u16) / 2), |
| 33 | Constraint::Length(width), |
| 34 | Constraint::Percentage((100 - width as u16) / 2), |
| 35 | ]) |
| 36 | .split(popup_layout[1])[1] |
| 37 | } |
| 38 | |
| 39 | pub fn footer(area: Rect, height: u16) -> Rect { |
| 40 | let layout = Layout::default() |
nothing calls this directly
no outgoing calls
no test coverage detected