mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-09-19 13:36:42 +02:00
add Layout trait
This commit is contained in:
parent
1f60b43f61
commit
09463649c6
6 changed files with 208 additions and 222 deletions
|
|
@ -73,23 +73,23 @@ pub fn iter_west <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
|
|||
pub fn row_south <S: Screen> (south: S::Unit, height: S::Unit, content: impl Draw<S>)
|
||||
-> impl Draw<S>
|
||||
{
|
||||
y_push(south, h_exact(height, content))
|
||||
content.exact_h(height).push_y(south)
|
||||
}
|
||||
|
||||
pub fn row_north <S: Screen> (north: S::Unit, height: S::Unit, content: impl Draw<S>)
|
||||
-> impl Draw<S>
|
||||
{
|
||||
y_pull(north, h_exact(height, content))
|
||||
content.exact_h(height).pull_y(north)
|
||||
}
|
||||
|
||||
pub fn col_east <S: Screen> (east: S::Unit, width: S::Unit, content: impl Draw<S>)
|
||||
-> impl Draw<S>
|
||||
{
|
||||
x_push(east, h_exact(width, content))
|
||||
content.exact_w(width).push_x(east)
|
||||
}
|
||||
|
||||
pub fn col_west <S: Screen> (west: S::Unit, width: S::Unit, content: impl Draw<S>)
|
||||
-> impl Draw<S>
|
||||
{
|
||||
x_pull(west, h_exact(width, content))
|
||||
content.exact_w(width).pull_x(west)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue