Fix tests
This commit is contained in:
7 files changed
+35
-63
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
use dioxus::html::geometry::euclid::Vector3D;
|
use dioxus::html::geometry::euclid::Vector3D;
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use dioxus_desktop::DesktopContext;
|
use dioxus_desktop::DesktopContext;
|
||||||
|
use dioxus_html::PointInteraction;
|
||||||
|
|
||||||
pub(crate) fn check_app_exits(app: Component) {
|
pub(crate) fn check_app_exits(app: Component) {
|
||||||
use dioxus_desktop::tao::window::WindowBuilder;
|
use dioxus_desktop::tao::window::WindowBuilder;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use dioxus::core::RenderReturn;
|
use dioxus::core::RenderReturn;
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
use dioxus_html::PointInteraction;
|
||||||
use dioxus_tui::DioxusElementToNodeId;
|
use dioxus_tui::DioxusElementToNodeId;
|
||||||
use dioxus_tui::Query;
|
use dioxus_tui::Query;
|
||||||
use dioxus_tui::Size;
|
use dioxus_tui::Size;
|
||||||
@@ -29,7 +30,7 @@ fn app(cx: Scope) -> Element {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hsl({hue}, 70%, {brightness}%)",
|
"hsl({hue}, 70%, {brightness}%)"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
use dioxus::{events::MouseData, prelude::*};
|
use dioxus::{events::MouseData, prelude::*};
|
||||||
use dioxus_core::Event;
|
use dioxus_core::Event;
|
||||||
|
use dioxus_html::PointInteraction;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
@@ -52,15 +53,9 @@ fn app(cx: Scope) -> Element {
|
|||||||
};
|
};
|
||||||
|
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
div {
|
div { width: "100%", height: "100%", flex_direction: "column",
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
flex_direction: "column",
|
|
||||||
|
|
||||||
div {
|
div { width: "100%", height: "50%", flex_direction: "row",
|
||||||
width: "100%",
|
|
||||||
height: "50%",
|
|
||||||
flex_direction: "row",
|
|
||||||
div {
|
div {
|
||||||
border_width: "1px",
|
border_width: "1px",
|
||||||
width: "50%",
|
width: "50%",
|
||||||
@@ -92,10 +87,7 @@ fn app(cx: Scope) -> Element {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div {
|
div { width: "100%", height: "50%", flex_direction: "row",
|
||||||
width: "100%",
|
|
||||||
height: "50%",
|
|
||||||
flex_direction: "row",
|
|
||||||
div {
|
div {
|
||||||
width: "50%",
|
width: "50%",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
@@ -124,11 +116,11 @@ fn app(cx: Scope) -> Element {
|
|||||||
onmousemove: update_data,
|
onmousemove: update_data,
|
||||||
"click me"
|
"click me"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
div {"Page coordinates: {page_coordinates}"},
|
div { "Page coordinates: {page_coordinates}" }
|
||||||
div {"Element coordinates: {element_coordinates}"},
|
div { "Element coordinates: {element_coordinates}" }
|
||||||
div {"Buttons: {buttons}"},
|
div { "Buttons: {buttons}" }
|
||||||
div {"Modifiers: {modifiers}"},
|
div { "Modifiers: {modifiers}" }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, MouseButton, MouseEvent};
|
use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, MouseButton, MouseEvent};
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use dioxus_html::input_data::keyboard_types::Code;
|
use dioxus_html::input_data::keyboard_types::Code;
|
||||||
|
use dioxus_html::PointInteraction;
|
||||||
use dioxus_tui::TuiContext;
|
use dioxus_tui::TuiContext;
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
@@ -63,7 +64,7 @@ fn key_down() {
|
|||||||
onkeydown: move |evt| {
|
onkeydown: move |evt| {
|
||||||
assert_eq!(evt.data.code(), Code::KeyA);
|
assert_eq!(evt.data.code(), Code::KeyA);
|
||||||
tui_ctx.quit();
|
tui_ctx.quit();
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -95,9 +96,11 @@ fn mouse_down() {
|
|||||||
width: "100%",
|
width: "100%",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
onmousedown: move |evt| {
|
onmousedown: move |evt| {
|
||||||
assert!(evt.data.held_buttons().contains(dioxus_html::input_data::MouseButton::Primary));
|
assert!(
|
||||||
|
evt.data.held_buttons().contains(dioxus_html::input_data::MouseButton::Primary)
|
||||||
|
);
|
||||||
tui_ctx.quit();
|
tui_ctx.quit();
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -131,13 +134,9 @@ fn mouse_up() {
|
|||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
}));
|
}));
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
div {
|
div { width: "100%", height: "100%", onmouseup: move |_| {
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
onmouseup: move |_| {
|
|
||||||
tui_ctx.quit();
|
tui_ctx.quit();
|
||||||
},
|
} }
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,13 +169,9 @@ fn mouse_enter() {
|
|||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
}));
|
}));
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
div {
|
div { width: "50%", height: "50%", onmouseenter: move |_| {
|
||||||
width: "50%",
|
|
||||||
height: "50%",
|
|
||||||
onmouseenter: move |_| {
|
|
||||||
tui_ctx.quit();
|
tui_ctx.quit();
|
||||||
},
|
} }
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -209,13 +204,9 @@ fn mouse_exit() {
|
|||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
}));
|
}));
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
div {
|
div { width: "50%", height: "50%", onmouseenter: move |_| {
|
||||||
width: "50%",
|
|
||||||
height: "50%",
|
|
||||||
onmouseenter: move |_| {
|
|
||||||
tui_ctx.quit();
|
tui_ctx.quit();
|
||||||
},
|
} }
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -248,13 +239,9 @@ fn mouse_move() {
|
|||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
}));
|
}));
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
div {
|
div { width: "100%", height: "100%", onmousemove: move |_| {
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
onmousemove: move |_|{
|
|
||||||
tui_ctx.quit();
|
tui_ctx.quit();
|
||||||
},
|
} }
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -293,7 +280,7 @@ fn wheel() {
|
|||||||
onwheel: move |evt| {
|
onwheel: move |evt| {
|
||||||
assert!(evt.data.delta().strip_units().y > 0.0);
|
assert!(evt.data.delta().strip_units().y > 0.0);
|
||||||
tui_ctx.quit();
|
tui_ctx.quit();
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -327,13 +314,9 @@ fn click() {
|
|||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
}));
|
}));
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
div {
|
div { width: "100%", height: "100%", onclick: move |_| {
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
onclick: move |_|{
|
|
||||||
tui_ctx.quit();
|
tui_ctx.quit();
|
||||||
},
|
} }
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -366,13 +349,9 @@ fn context_menu() {
|
|||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
}));
|
}));
|
||||||
cx.render(rsx! {
|
cx.render(rsx! {
|
||||||
div {
|
div { width: "100%", height: "100%", oncontextmenu: move |_| {
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
oncontextmenu: move |_|{
|
|
||||||
tui_ctx.quit();
|
tui_ctx.quit();
|
||||||
},
|
} }
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,6 +36,7 @@ pub use transit::*;
|
|||||||
pub use elements::*;
|
pub use elements::*;
|
||||||
pub use events::*;
|
pub use events::*;
|
||||||
pub use global_attributes::*;
|
pub use global_attributes::*;
|
||||||
|
pub use point_interaction::PointInteraction;
|
||||||
pub use render_template::*;
|
pub use render_template::*;
|
||||||
|
|
||||||
mod eval;
|
mod eval;
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ use dioxus_html::input_data::keyboard_types::{Code, Key, Location, Modifiers};
|
|||||||
use dioxus_html::input_data::{
|
use dioxus_html::input_data::{
|
||||||
MouseButton as DioxusMouseButton, MouseButtonSet as DioxusMouseButtons,
|
MouseButton as DioxusMouseButton, MouseButtonSet as DioxusMouseButtons,
|
||||||
};
|
};
|
||||||
use dioxus_html::point_interaction::{PointData, PointInteraction};
|
use dioxus_html::point_interaction::PointData;
|
||||||
use dioxus_html::{event_bubbles, FocusData, KeyboardData, MouseData, WheelData};
|
use dioxus_html::{event_bubbles, FocusData, KeyboardData, MouseData, PointInteraction, WheelData};
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::{
|
use std::{
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use dioxus_html::{
|
use dioxus_html::{input_data::keyboard_types::Key, KeyboardData, MouseData, PointInteraction};
|
||||||
input_data::keyboard_types::Key, point_interaction::PointInteraction, KeyboardData, MouseData,
|
|
||||||
};
|
|
||||||
use dioxus_native_core::{
|
use dioxus_native_core::{
|
||||||
custom_element::CustomElement,
|
custom_element::CustomElement,
|
||||||
node::{OwnedAttributeDiscription, OwnedAttributeValue},
|
node::{OwnedAttributeDiscription, OwnedAttributeValue},
|
||||||
|
|||||||
Reference in new issue
Block a user