outlines
This commit is contained in:
+13
-27
@@ -10,33 +10,19 @@ fn main() -> std::io::Result<()> {
|
||||
|
||||
fn app() -> Rsx {
|
||||
rsx! {
|
||||
@Transform::center();
|
||||
FlexCol {
|
||||
test => (1)
|
||||
test => (3)
|
||||
} (0x0000ff, 4)
|
||||
}
|
||||
}
|
||||
|
||||
fn test(inc: i32) -> Rsx {
|
||||
let count = use_state(0);
|
||||
|
||||
std::thread::spawn({
|
||||
let count = count.clone();
|
||||
move || loop {
|
||||
std::thread::sleep(std::time::Duration::from_millis(50));
|
||||
**count.get() += inc;
|
||||
}
|
||||
});
|
||||
|
||||
rsx! {
|
||||
@Transform::new().dimensions(40, 3);
|
||||
@transform! {
|
||||
width: Full,
|
||||
height: Full,
|
||||
};
|
||||
Div {
|
||||
@transform! { x: Center, y: Center, width: 5 };
|
||||
Div {
|
||||
%count
|
||||
"{count}"
|
||||
} (0x00ff00)
|
||||
} (0xff0000)
|
||||
@transform! {
|
||||
width: Full,
|
||||
height: Full,
|
||||
};
|
||||
RoundedOutline {}
|
||||
|
||||
@Transform::center();
|
||||
"Welcome To OSUI!"
|
||||
} (0x000000)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user