diff --git a/examples/draw.rs b/examples/draw.rs index 3c3bed9e56254929b41704fb037b611194405301..93f6888376316da304addeb162facfaad311d847 100644 --- a/examples/draw.rs +++ b/examples/draw.rs @@ -115,11 +115,9 @@ impl Widget<Envelope> for Draw { _data: &Envelope, _env: &Env, ) -> Size { - // info!("layout bc {:?}", bc); - // info!("layout bc.min {:?}", bc.min()); - - // bc.min() - bc.constrain((100.0, 100.0)) // this is probably incorrect + info!("layout bc {:?}", bc); + info!("layout bc.min {:?}", bc.min()); + bc.constrain((100.0, 100.0)) // this gives a firm size, which is not what I want } fn paint(&mut self, paint_ctx: &mut PaintCtx, data: &Envelope, _env: &Env) { @@ -174,12 +172,14 @@ impl Adsr { Flex::column() .with_child( Draw {} + //.expand() // this would expand to the whole window .lens(Adsr::envelope) .background(solid.clone()) .padding(5.0), 0.0, ) .with_child(Envelope::new().lens(Adsr::envelope).padding(5.0), 0.0) + // .expand() // this gives very strange and erroneous layout } } @@ -190,22 +190,22 @@ fn build_app() -> impl Widget<Adsr> { .with_child( Flex::row() .with_child(Adsr::new().padding(10.0), 0.0) - //.with_child(Adsr::new().expand().padding(10.0), 0.0) + //.with_child(Adsr::new().expand().padding(5.0), 0.0) .with_child( Label::new("top right") .background(solid.clone()) - .padding(10.0), + .padding(5.0), 1.0, ), 1.0, ) .with_child( Flex::row() - .with_child(Label::new("bottom left").padding(10.0), 1.0) + .with_child(Label::new("bottom left").padding(5.0), 1.0) .with_child( Label::new("bottom right") .border(solid.clone(), 4.0) - .padding(10.0), + .padding(5.0), 1.0, ), 1.0,