mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Improve similarity of testing APIs between C++ and Rust
Let send_mouse_click also take a component reference, like in C++.
This commit is contained in:
parent
4670854500
commit
23d54b1b89
12 changed files with 34 additions and 33 deletions
|
@ -269,12 +269,13 @@ pub mod testing {
|
|||
/// Simulate a mouse click
|
||||
pub fn send_mouse_click<
|
||||
X: vtable::HasStaticVTable<sixtyfps_corelib::component::ComponentVTable> + HasWindow + 'static,
|
||||
Component: Into<vtable::VRc<sixtyfps_corelib::component::ComponentVTable, X>> + Clone,
|
||||
>(
|
||||
component: impl Into<vtable::VRc<sixtyfps_corelib::component::ComponentVTable, X>>,
|
||||
component: &Component,
|
||||
x: f32,
|
||||
y: f32,
|
||||
) {
|
||||
let rc = component.into();
|
||||
let rc = component.clone().into();
|
||||
let dyn_rc = vtable::VRc::into_dyn(rc.clone());
|
||||
sixtyfps_corelib::tests::sixtyfps_send_mouse_click(&dyn_rc, x, y, rc.component_window());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue