fix: cargo check
This commit is contained in:
1 parent
02b1a73890
commit
fc2aaa7df5
2 files changed
+9
-7
No files matched your search
@@ -63,7 +63,7 @@ fn contexts_drop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
fn tasks_drop() {
|
async fn tasks_drop() {
|
||||||
fn app(cx: Scope) -> Element {
|
fn app(cx: Scope) -> Element {
|
||||||
cx.spawn(async {
|
cx.spawn(async {
|
||||||
tokio::time::sleep(std::time::Duration::from_millis(100000)).await;
|
tokio::time::sleep(std::time::Duration::from_millis(100000)).await;
|
||||||
|
|||||||
@@ -17,12 +17,14 @@ fn app(cx: Scope) -> Element {
|
|||||||
width: "100%",
|
width: "100%",
|
||||||
background_color: "hsl({hue}, 70%, {brightness}%)",
|
background_color: "hsl({hue}, 70%, {brightness}%)",
|
||||||
onmousemove: move |evt| {
|
onmousemove: move |evt| {
|
||||||
if let RenderReturn::Sync(Ok(node))=cx.root_node(){
|
if let RenderReturn::Sync(Ok(node)) = cx.root_node() {
|
||||||
let node = tui_query.get(node.root_ids[0].get());
|
if let Some(id) = node.root_ids[0].get() {
|
||||||
let Size{width, height} = node.size().unwrap();
|
let node = tui_query.get(id);
|
||||||
let pos = evt.inner().element_coordinates();
|
let Size{width, height} = node.size().unwrap();
|
||||||
hue.set((pos.x as f32/width as f32)*255.0);
|
let pos = evt.inner().element_coordinates();
|
||||||
brightness.set((pos.y as f32/height as f32)*100.0);
|
hue.set((pos.x as f32/width as f32)*255.0);
|
||||||
|
brightness.set((pos.y as f32/height as f32)*100.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hsl({hue}, 70%, {brightness}%)",
|
"hsl({hue}, 70%, {brightness}%)",
|
||||||
|
|||||||
Reference in new issue
Block a user