Add basic "join room" overlay
This commit is contained in:
parent
8d1b1951f4
commit
3ac3bbb99e
6 changed files with 194 additions and 60 deletions
14
cove-tui/src/ui/layout.rs
Normal file
14
cove-tui/src/ui/layout.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use tui::layout::Rect;
|
||||
|
||||
pub fn centered(width: u16, height: u16, area: Rect) -> Rect {
|
||||
let width = width.min(area.width);
|
||||
let height = height.min(area.height);
|
||||
let dx = (area.width - width) / 2;
|
||||
let dy = (area.height - height) / 2;
|
||||
Rect {
|
||||
x: area.x + dx,
|
||||
y: area.y + dy,
|
||||
width,
|
||||
height,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue