slint-ui 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.ts +4 -0
- package/native/Cargo.toml +4 -4
- package/native/lib.rs +8 -0
- package/package.json +1 -1
package/lib/index.ts
CHANGED
|
@@ -67,6 +67,7 @@ interface Size {
|
|
|
67
67
|
interface SlintWindow {
|
|
68
68
|
show(): void;
|
|
69
69
|
hide(): void;
|
|
70
|
+
is_visible: boolean;
|
|
70
71
|
logical_position: Point;
|
|
71
72
|
physical_position: Point;
|
|
72
73
|
logical_size: Size;
|
|
@@ -89,6 +90,9 @@ class WindowAPI implements SlintWindow {
|
|
|
89
90
|
hide(): void {
|
|
90
91
|
this.impl.hide();
|
|
91
92
|
}
|
|
93
|
+
get is_visible(): boolean {
|
|
94
|
+
return this.impl.get_is_visible();
|
|
95
|
+
}
|
|
92
96
|
get logical_position(): Point {
|
|
93
97
|
return this.impl.get_logical_position();
|
|
94
98
|
}
|
package/native/Cargo.toml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
[package]
|
|
5
5
|
name = "slint-node"
|
|
6
|
-
version = "0.3.
|
|
6
|
+
version = "0.3.2"
|
|
7
7
|
authors = ["Slint Developers <info@slint-ui.com>"]
|
|
8
8
|
edition = "2021"
|
|
9
9
|
build = "build.rs"
|
|
@@ -20,9 +20,9 @@ crate-type = ["cdylib"]
|
|
|
20
20
|
name = "slint_node_native"
|
|
21
21
|
|
|
22
22
|
[dependencies]
|
|
23
|
-
i-slint-compiler = { version = "=0.3.
|
|
24
|
-
i-slint-core = { version = "=0.3.
|
|
25
|
-
slint-interpreter = { version = "=0.3.
|
|
23
|
+
i-slint-compiler = { version = "=0.3.2"}
|
|
24
|
+
i-slint-core = { version = "=0.3.2"}
|
|
25
|
+
slint-interpreter = { version = "=0.3.2", features = ["display-diagnostics"] }
|
|
26
26
|
|
|
27
27
|
vtable = { version = "0.1.6"}
|
|
28
28
|
|
package/native/lib.rs
CHANGED
|
@@ -166,6 +166,7 @@ fn to_eval_value<'cx>(
|
|
|
166
166
|
| Type::Angle
|
|
167
167
|
| Type::PhysicalLength
|
|
168
168
|
| Type::LogicalLength
|
|
169
|
+
| Type::Rem
|
|
169
170
|
| Type::Percent
|
|
170
171
|
| Type::UnitProduct(_) => {
|
|
171
172
|
Ok(Value::Number(val.downcast_or_throw::<JsNumber, _>(cx)?.value()))
|
|
@@ -501,6 +502,13 @@ declare_types! {
|
|
|
501
502
|
Ok(JsUndefined::new().as_value(&mut cx))
|
|
502
503
|
}
|
|
503
504
|
|
|
505
|
+
method get_is_visible(mut cx) {
|
|
506
|
+
let this = cx.this();
|
|
507
|
+
let window = cx.borrow(&this, |x| x.0.as_ref().cloned());
|
|
508
|
+
let window_adapter = window.ok_or(()).or_else(|()| cx.throw_error("Invalid type"))?;
|
|
509
|
+
Ok(JsBoolean::new(&mut cx, window_adapter.window().is_visible()).as_value(&mut cx))
|
|
510
|
+
}
|
|
511
|
+
|
|
504
512
|
method get_logical_position(mut cx) {
|
|
505
513
|
let this = cx.this();
|
|
506
514
|
let window = cx.borrow(&this, |x| x.0.as_ref().cloned());
|