mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 22:31:14 +00:00
Add a nodejs testing function for apply_layout
This will allow making the JS test code more similar to the C++/Rust code, allowing replacing synthetic mouse clicks.
This commit is contained in:
parent
8fb0c060d6
commit
beb5d63d1b
4 changed files with 36 additions and 2 deletions
|
@ -26,6 +26,16 @@ function load_native_lib() {
|
|||
*/
|
||||
let native = !process.env.SIXTYFPS_NODE_NATIVE_LIB ? require('../native/index.node') : load_native_lib();
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
interface Rect {
|
||||
x: number,
|
||||
y: number,
|
||||
width: number,
|
||||
height: number
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
|
@ -55,6 +65,10 @@ class Component {
|
|||
send_keyboard_string_sequence(s: String) {
|
||||
this.comp.send_keyboard_string_sequence(s)
|
||||
}
|
||||
|
||||
apply_layout(rect: Rect) {
|
||||
this.comp.apply_layout(rect)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue