Skip to content
Snippets Groups Projects
Commit 1d245cc5 authored by Per Lindgren's avatar Per Lindgren
Browse files

ADSR with a viev (padding experiment)

parent c0d3af69
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment