Skip to content

fudini/f-layout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust layout

fn main() {

  let main_cell = Composite {
    layout: Layout::Vertical,
    items: vec!(
      Component { id: 2, size: Fixed(1), cell: Cell::Leaf },
      Component { id: 3, size: Flex(3.0), cell: Cell::Leaf },
    )
  };

  let component = Component {
    id: 1,
    size: Size::Flex(1.0),
    cell: Cell::Composite(Composite {
      layout: Layout::Horizontal,
      items: vec!(
        Component { id: 0, size: Flex(1.0), cell: Cell::Composite(main_cell) },
        Component { id: 1, size: Fixed(1), cell: Cell::Leaf },
      )
    }),
  };

  let resolved = resolve(&component, rect(0.0, 0.0, 50.0, 50.0));

  println!("{:?}", resolved);
}

About

Layout lib for Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages