-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add auto min-size * Add auto min-size * Fix for computing auto size from children * Fix min/max order * Fix auto min content size * Fmt * Clippy * Remove playground * cleanup
- Loading branch information
Showing
12 changed files
with
628 additions
and
1,905 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
|
||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Basic", | ||
"program": "${workspaceFolder}/target/debug/examples/basic", | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Menu", | ||
"program": "${workspaceFolder}/target/debug/examples/menu", | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
mod common; | ||
use common::*; | ||
|
||
fn main() { | ||
let mut world = World::default(); | ||
|
||
let root = world.add(None); | ||
world.set_width(root, Units::Pixels(600.0)); | ||
world.set_height(root, Units::Pixels(600.0)); | ||
world.set_child_space(root, Units::Stretch(1.0)); | ||
|
||
let node = world.add(Some(root)); | ||
world.set_width(node, Units::Auto); | ||
world.set_height(node, Units::Auto); | ||
|
||
let child = world.add(Some(node)); | ||
world.set_width(child, Units::Stretch(1.0)); | ||
world.set_min_width(child, Units::Auto); | ||
world.set_height(child, Units::Pixels(50.0)); | ||
world.set_content_size(child, |_, _, height| { | ||
let h = height.unwrap(); | ||
(50.0, h) | ||
}); | ||
|
||
let child = world.add(Some(node)); | ||
world.set_width(child, Units::Stretch(1.0)); | ||
world.set_min_width(child, Units::Auto); | ||
world.set_height(child, Units::Pixels(50.0)); | ||
world.set_content_size(child, |_, _, height| { | ||
let h = height.unwrap(); | ||
(60.0, h) | ||
}); | ||
|
||
let child = world.add(Some(node)); | ||
world.set_width(child, Units::Stretch(1.0)); | ||
world.set_min_width(child, Units::Auto); | ||
world.set_height(child, Units::Pixels(50.0)); | ||
world.set_content_size(child, |_, _, height| { | ||
let h = height.unwrap(); | ||
(130.0, h) | ||
}); | ||
|
||
let child = world.add(Some(node)); | ||
world.set_width(child, Units::Stretch(1.0)); | ||
world.set_min_width(child, Units::Auto); | ||
world.set_height(child, Units::Pixels(50.0)); | ||
world.set_content_size(child, |_, _, height| { | ||
let h = height.unwrap(); | ||
(80.0, h) | ||
}); | ||
|
||
root.layout(&mut world.cache, &world.tree, &world.store, &mut ()); | ||
|
||
render(world, root); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.