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

ADSR with a viev (padding experiment)

parent e161728f
No related branches found
No related tags found
No related merge requests found
...@@ -115,6 +115,10 @@ impl Widget<Envelope> for Draw { ...@@ -115,6 +115,10 @@ impl Widget<Envelope> for Draw {
_data: &Envelope, _data: &Envelope,
_env: &Env, _env: &Env,
) -> Size { ) -> Size {
// info!("layout bc {:?}", bc);
// info!("layout bc.min {:?}", bc.min());
// bc.min()
bc.constrain((100.0, 100.0)) // this is probably incorrect bc.constrain((100.0, 100.0)) // this is probably incorrect
} }
...@@ -179,8 +183,36 @@ impl Adsr { ...@@ -179,8 +183,36 @@ impl Adsr {
} }
} }
fn build_app() -> impl Widget<Adsr> {
let solid = Color::rgb8(0x3a, 0x3a, 0x3a);
Flex::column()
.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(
Label::new("top right")
.background(solid.clone())
.padding(10.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 right")
.border(solid.clone(), 4.0)
.padding(10.0),
1.0,
),
1.0,
)
}
fn main() -> Result<(), PlatformError> { fn main() -> Result<(), PlatformError> {
AppLauncher::with_window(WindowDesc::new(Adsr::new)) AppLauncher::with_window(WindowDesc::new(build_app))
.use_simple_logger() .use_simple_logger()
.launch(Adsr { .launch(Adsr {
envelope: Envelope { envelope: Envelope {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment