test
This commit is contained in:
@@ -4,6 +4,8 @@ pub fn todo_app() -> Element {
|
|||||||
let todo = vec!["Foo", "Bar"];
|
let todo = vec!["Foo", "Bar"];
|
||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
|
// text { class: "title", "Todo list app made with OSUI" }
|
||||||
|
// text { class: "title", "{}", "-".repeat(crossterm::terminal::size().unwrap().0 as usize) }
|
||||||
for (t in todo) {
|
for (t in todo) {
|
||||||
ersx!( button{ class: "todo", on_click: fn(btn: &mut Button, _, _) {
|
ersx!( button{ class: "todo", on_click: fn(btn: &mut Button, _, _) {
|
||||||
btn.class = if btn.class == "todo" {
|
btn.class = if btn.class == "todo" {
|
||||||
@@ -23,10 +25,23 @@ pub fn todo_styling() -> Css {
|
|||||||
y: Auto,
|
y: Auto,
|
||||||
color: Red,
|
color: Red,
|
||||||
}
|
}
|
||||||
|
"todo": "hover" {
|
||||||
|
color: Blue
|
||||||
|
}
|
||||||
"complete" {
|
"complete" {
|
||||||
x: 0 px,
|
x: 0 px,
|
||||||
y: Auto,
|
y: Auto,
|
||||||
color: Green,
|
color: Green,
|
||||||
}
|
}
|
||||||
|
"complete": "hover" {
|
||||||
|
color: Cyan
|
||||||
|
}
|
||||||
|
"title" {
|
||||||
|
x: 0 px,
|
||||||
|
y: Auto,
|
||||||
|
}
|
||||||
|
"title": "hover" {
|
||||||
|
color: Blue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ macro_rules! parse_rsx_param {
|
|||||||
};
|
};
|
||||||
|
|
||||||
($elem:expr, $text:expr, $($inner:tt)*) => {
|
($elem:expr, $text:expr, $($inner:tt)*) => {
|
||||||
$elem.children.set_text_force(&format!($text, $($inner)*))
|
$elem.children.set_text_force(std::sync::Arc::new(move || format!($text, $($inner)*)))
|
||||||
};
|
};
|
||||||
|
|
||||||
($elem:expr, ) => {};
|
($elem:expr, ) => {};
|
||||||
|
|||||||
Reference in New Issue
Block a user