feat: support desktop more completely

This commit is contained in:
Jonathan Kelley committed 2021-10-05 03:37:15 -04:00
1 parent a2b0c50a34
commit efd0e9b564
25 files changed
+701 -441

No files matched your search

+1 -2
View File
@@ -15,8 +15,7 @@ fn main() {
dioxus::desktop::wry::application::dpi::LogicalSize::new(400.0, 800.0),
)
})
})
.unwrap();
});
}
static App: FC<()> = |cx, props| {
+7 -4
View File
@@ -14,13 +14,16 @@ fn main() {
let edits = vec![
// create a container and push it onto the stack
CreateElement { tag: "div", id: 0 },
CreateElement {
tag: "div",
root: 0,
},
// create an element and push it onto the stack
CreateElement { tag: "h1", id: 2 },
CreateElement { tag: "h1", root: 2 },
// create a text node and push it onto the stack
CreateTextNode {
text: "hello world",
id: 3,
root: 3,
},
// append the text node to the h1 element
AppendChildren { many: 1 },
@@ -30,7 +33,7 @@ fn main() {
AppendChildren { many: 1 },
];
dioxus_desktop::run(APP, (), |c| c.with_edits(edits)).unwrap();
dioxus_desktop::run(APP, (), |c| c.with_edits(edits));
}
const APP: FC<()> = |cx, _props| {