slint-ui 1.0.1 → 1.1.0
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/LICENSE.md +7 -2
- package/LICENSES/LicenseRef-Slint-Royalty-free-1.0.md +37 -0
- package/LICENSES/LicenseRef-Slint-commercial.md +25 -47
- package/README.md +3 -3
- package/cover.md +2 -2
- package/dist/index.js +2 -2
- package/lib/index.ts +2 -2
- package/loader.mjs +2 -2
- package/native/Cargo.toml +9 -9
- package/native/build.rs +2 -2
- package/native/js_model.rs +2 -2
- package/native/lib.rs +12 -7
- package/native/persistent_context.rs +2 -2
- package/package.json +1 -1
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Slint License
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
You can use Slint under ***any*** of the following licenses, at your choice:
|
|
4
|
+
|
|
5
|
+
1. [Royalty-free license](LICENSES/LicenseRef-Slint-Royalty-free-1.0.md),
|
|
6
|
+
2. [GNU GPLv3](LICENSES/GPL-3.0-only.txt),
|
|
7
|
+
3. [Paid license](https://slint.dev/pricing.html).
|
|
5
8
|
|
|
6
9
|
Third party licenses listed in the `LICENSES` folder also apply to parts of the product.
|
|
10
|
+
|
|
11
|
+
Contact us at [info@slint.dev](mailto:info@slint.dev) if you have any questions regarding licensing.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Slint Royalty-free Desktop and Web Applications License, version 1.0
|
|
2
|
+
|
|
3
|
+
## Preamble
|
|
4
|
+
|
|
5
|
+
Slint is a toolkit that can be used to build user interfaces for applications. Slint (hereafter referred to as "Software") is made available under different licenses by SixtyFPS GmbH incorporated at Oranienburger Str. 44, 16540 Hohen Neuendorf, Germany ("SixtyFPS"). The "Slint Royalty-free Desktop and Web Applications License" is suitable for those who develop desktop or web applications and do not want to use open source components under copyleft licenses.
|
|
6
|
+
|
|
7
|
+
### 1. Grant of Rights
|
|
8
|
+
|
|
9
|
+
SixtyFPS hereby grants You a world-wide, royalty-free, non-exclusive license to use, reproduce, make available, modify, display, perform, distribute the Software as part of a Desktop or Web Application.
|
|
10
|
+
|
|
11
|
+
A Desktop Application is a computer program that is designed to run on a general-purpose computer (PC or notebook), typically installed and executed locally on the computer's operating system. A Web Application is a computer program that is running on a server and accessed using a web browser or client program.
|
|
12
|
+
|
|
13
|
+
Desktop Application and Web Application are hereafter referred to as "Application".
|
|
14
|
+
|
|
15
|
+
### 2. Limitations
|
|
16
|
+
|
|
17
|
+
The license does not permit to distribute or make the Software publicly available alone and without integration into an Application. For this purpose you may use the Software under the GNU General Public License, version 3.
|
|
18
|
+
|
|
19
|
+
The license does not permit the use of the Software within Embedded Systems. An Embedded System is a computer system designed to perform a specific task within a larger mechanical or electrical system. For the purposes of this license, mobile phones are not considered to be Embedded Systems.
|
|
20
|
+
|
|
21
|
+
### 3. License Conditions - Attribution
|
|
22
|
+
|
|
23
|
+
You may distribute the Software as part of an Application, modified or unmodified, provided that You do all of the following:
|
|
24
|
+
|
|
25
|
+
(a) Display the [`AboutSlint`](https://slint.dev/snapshots/master/docs/slint/src/builtins/widgets.html#aboutslint) widget in an "About" screen or dialog that is accessible from the top level menu of the Application.
|
|
26
|
+
|
|
27
|
+
(b) Display the [Slint attribution badge](https://github.com/slint-ui/slint/tree/master/logo/madewithslint) on a public webpage, preferably where the binaries of your Application can be downloaded from, in such a way that it can be easily found by any visitor to that page.
|
|
28
|
+
|
|
29
|
+
(c) You may not remove or alter any license notices (including copyright notices, disclaimers of warranty, or limitations of liability) contained within the source code form of the Software.
|
|
30
|
+
|
|
31
|
+
(d) You allow SixtyFPS to show your Application on <https://madewithslint.com> and in advertising materials of SixtyFPS as a reference and to display your logo and trademark for this purpose.
|
|
32
|
+
|
|
33
|
+
### 4. Warranty and Liability
|
|
34
|
+
|
|
35
|
+
SixtyFPS is only liable for conflicting rights of third parties if SixtyFPS was aware of these rights without informing you. Unless required by applicable law or agreed to in writing, SixtyFPS provides the SOFTWARE on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
|
36
|
+
|
|
37
|
+
UNLESS REQUIRED BY LAW, SIXTYFPS WON'T BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Slint Software License Agreement
|
|
2
2
|
|
|
3
|
-
Version
|
|
3
|
+
Version 2.0
|
|
4
4
|
|
|
5
|
-
Copyright ©
|
|
5
|
+
Copyright © 2023 SixtyFPS GmbH <https://slint.dev/imprint.html>
|
|
6
6
|
|
|
7
7
|
SixtyFPS GmbH with offices at Oranienburger Str. 44, 16540 Hohen Neuendorf,
|
|
8
8
|
Germany (**SixtyFPS**, **us**, **we** or **our**) grants a license to the
|
|
@@ -102,55 +102,38 @@ The Licensed Software includes
|
|
|
102
102
|
date, the license shall not be granted and your Products shall be deemed as
|
|
103
103
|
made in breach of the Agreement ex tunc.
|
|
104
104
|
|
|
105
|
-
11.
|
|
106
|
-
the **Ambassador** program. Instead, the license grants shall be conditional
|
|
107
|
-
on the fulfillment of the obligations as specified herein. If said
|
|
108
|
-
obligations are not fulfilled, the license shall not be granted and your
|
|
109
|
-
Products shall be deemed as made in breach of the Agreement ex tunc. The
|
|
110
|
-
obligations are as follows:
|
|
111
|
-
|
|
112
|
-
1. Showcase: You grant us the right to use your name, logo, and your
|
|
113
|
-
Products in our marketing materials,
|
|
114
|
-
|
|
115
|
-
2. Spread the word: You will include visible notices in the documentation,
|
|
116
|
-
marketing materials, and social media channels related to your Products
|
|
117
|
-
that such were built with the Licensed Software,
|
|
118
|
-
|
|
119
|
-
3. Give feedback: You agree to provide feedback that would help us improve
|
|
120
|
-
the Licensed Software. We may use any such feedback in testimonials.
|
|
121
|
-
|
|
122
|
-
12. The Fees and any other charges under this Agreement shall be paid by
|
|
105
|
+
11. The Fees and any other charges under this Agreement shall be paid by
|
|
123
106
|
you no later than thirty (30) days from the date of the applicable
|
|
124
107
|
invoice from us. A late payment charge of five percent per month over and
|
|
125
108
|
above the interest rate stipulated by applicable law shall be charged on any
|
|
126
109
|
unpaid balances that remain past due and which have not been disputed by you
|
|
127
110
|
in good faith.
|
|
128
111
|
|
|
129
|
-
|
|
112
|
+
12. The Fees and any other charges payable under this Agreement are gross
|
|
130
113
|
amounts but exclusive of any value added tax, use tax, sales tax,
|
|
131
114
|
withholding tax and other taxes, duties or tariffs levied directly for the
|
|
132
115
|
sale, delivery, or use of the Licensed Software pursuant to any applicable
|
|
133
116
|
law.
|
|
134
117
|
|
|
135
|
-
|
|
118
|
+
13. The Parties also agree to all the following conditions:
|
|
136
119
|
|
|
137
|
-
|
|
120
|
+
(a) You may not remove or alter any copyright, trademark, or other
|
|
138
121
|
proprietary rights notice contained in any portion of the Licensed
|
|
139
122
|
Software,
|
|
140
123
|
|
|
141
|
-
|
|
124
|
+
(b) Your Products may not compete with the Licensed Software,
|
|
142
125
|
|
|
143
|
-
|
|
126
|
+
(c) You will indemnify and hold us, our affiliated companies, and our
|
|
144
127
|
suppliers, harmless from and against any claims or liabilities
|
|
145
128
|
arising out of the use, reproduction, or distribution of your
|
|
146
|
-
Products, except as set out in clause
|
|
129
|
+
Products, except as set out in clause 13.(d) immediately below,
|
|
147
130
|
|
|
148
|
-
|
|
131
|
+
(d) We shall indemnify and hold you harmless from and against any
|
|
149
132
|
claims from third parties alleging that the use of the Licensed Software
|
|
150
133
|
as set out in this Agreement infringes or will infringe such third
|
|
151
134
|
parties' intellectual property rights or other rights,
|
|
152
135
|
|
|
153
|
-
|
|
136
|
+
(e) A Party shall promptly notify the other Party if it receives a claim that
|
|
154
137
|
the other Party shall or may be obliged to indemnify. The Parties shall
|
|
155
138
|
promptly give each other information and other assistance needed for
|
|
156
139
|
handling the claim. The Indemnifying Party may, at its cost and in its
|
|
@@ -168,7 +151,7 @@ The Licensed Software includes
|
|
|
168
151
|
the indemnifying Party, such consent not to be unreasonably withheld or
|
|
169
152
|
delayed.
|
|
170
153
|
|
|
171
|
-
|
|
154
|
+
14. The Licensed Software is licensed to you "as is". To the maximum extent
|
|
172
155
|
permitted by applicable law, we on behalf of us and our suppliers,
|
|
173
156
|
disclaim all warranties and conditions, either express or implied,
|
|
174
157
|
including, but not limited to, any implied warranties of merchantability or
|
|
@@ -178,7 +161,7 @@ The Licensed Software includes
|
|
|
178
161
|
state/jurisdiction to state/jurisdiction; as far as legally permissible, you
|
|
179
162
|
waive any such legal rights vis-à-vis us.
|
|
180
163
|
|
|
181
|
-
|
|
164
|
+
15. We shall not under any circumstances be liable to you based on failure of
|
|
182
165
|
the Licensed Software if the failure resulted from your changing of the
|
|
183
166
|
Licensed Software, from your accident, abuse or misapplication, nor shall
|
|
184
167
|
we except in case of gross negligence or willful misconduct be
|
|
@@ -187,7 +170,7 @@ The Licensed Software includes
|
|
|
187
170
|
nor shall any award of damages exceed the total amount you paid to us in
|
|
188
171
|
connection with this Agreement.
|
|
189
172
|
|
|
190
|
-
|
|
173
|
+
16. Each Party shall hold Confidential Information of the other Party, its
|
|
191
174
|
customers, and licensors in confidence, and without written permission from
|
|
192
175
|
will not disclose to any person or use for its own benefit, any such
|
|
193
176
|
information. **Confidential Information** includes without limitation the
|
|
@@ -219,7 +202,7 @@ The Licensed Software includes
|
|
|
219
202
|
remedies available, each Party shall be entitled to enforcement of such
|
|
220
203
|
obligations by court injunction.
|
|
221
204
|
|
|
222
|
-
|
|
205
|
+
17. During the Term, an independent, certified auditor on our behalf, may, upon
|
|
223
206
|
its reasonable request, with 30 (thirty) days written notice, and at its
|
|
224
207
|
sole expense, examine your books and records solely with respect to your use
|
|
225
208
|
of the Licensed Software. Any such audit shall be conducted during regular
|
|
@@ -232,41 +215,36 @@ The Licensed Software includes
|
|
|
232
215
|
of the terms of this Agreement, with a copy to you. You shall be provided
|
|
233
216
|
the right to provide comments to the report before it is finalized.
|
|
234
217
|
|
|
235
|
-
|
|
218
|
+
18. If you materially breach this Agreement, we will provide a 60 (sixty) days
|
|
236
219
|
written notice to you during which any such breach(es) may be cured, failing
|
|
237
|
-
which we will terminate the agreement.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
reduction. We shall in any case be free to assert any further damage/loss or
|
|
241
|
-
other claims. The amount of contractual penalty shall be offset against
|
|
242
|
-
claims for damages, if any.
|
|
243
|
-
|
|
244
|
-
20. You may terminate this Agreement at any time for any reason upon 90 (ninety)
|
|
220
|
+
which we will terminate the agreement.
|
|
221
|
+
|
|
222
|
+
19. You may terminate this Agreement at any time for any reason upon 30 (thirty)
|
|
245
223
|
days notice to us and upon payment of all applicable fees and contractual
|
|
246
224
|
penalties, if any, in connection with the use of the Licensed Software.
|
|
247
225
|
|
|
248
|
-
|
|
226
|
+
20. Both Parties shall comply with all applicable laws and regulations relating
|
|
249
227
|
to the Licensed Software in the countries in which the Parties use or modify
|
|
250
228
|
the Licensed Software.
|
|
251
229
|
|
|
252
|
-
|
|
230
|
+
21. All notices and communications between the Parties shall be in writing and
|
|
253
231
|
shall be deemed given when received. For avoidance of doubt, email is
|
|
254
232
|
considered a written form of communication.
|
|
255
233
|
|
|
256
|
-
|
|
234
|
+
22. This Agreement shall be construed, interpreted, and governed by the laws of
|
|
257
235
|
the Federal Republic of Germany.
|
|
258
236
|
|
|
259
|
-
|
|
237
|
+
23. No term or condition contained in your purchase order will apply unless
|
|
260
238
|
expressly accepted by us in writing.
|
|
261
239
|
|
|
262
|
-
|
|
240
|
+
24. You may assign this Agreement, in whole or in part (whether by operation of
|
|
263
241
|
law or otherwise), with prior consent from us, which shall not be
|
|
264
242
|
unreasonably withheld or delayed. We may assign this Agreement or any of its
|
|
265
243
|
rights hereunder or delegate any of its obligations hereunder with prior
|
|
266
244
|
notice to you. Any attempt to assign this Agreement other than in accordance
|
|
267
245
|
with this provision shall be null and void.
|
|
268
246
|
|
|
269
|
-
|
|
247
|
+
25. This Agreement constitutes the complete agreement between the Parties and
|
|
270
248
|
supersedes all prior or contemporaneous discussions, representations, and
|
|
271
249
|
proposals, written or oral, with respect to the subject matters discussed
|
|
272
250
|
herein. No modification of this Agreement will be effective unless contained
|
package/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/slint-ui)
|
|
4
4
|
|
|
5
|
-
[Slint](https://slint
|
|
5
|
+
[Slint](https://slint.dev/) is a UI toolkit that supports different programming languages.
|
|
6
6
|
Slint-node is the integration with node.
|
|
7
7
|
|
|
8
|
-
The complete Node documentation can be viewed online at https://slint
|
|
9
|
-
To get started you can use the [Walk-through tutorial](https://slint
|
|
8
|
+
The complete Node documentation can be viewed online at https://slint.dev/docs/node/.
|
|
9
|
+
To get started you can use the [Walk-through tutorial](https://slint.dev/docs/tutorial/node).
|
|
10
10
|
We also have a [Getting Started Template](https://github.com/slint-ui/slint-nodejs-template) repository with
|
|
11
11
|
the code of a minimal application using Slint that can be used as a starting point to your program.
|
|
12
12
|
|
package/cover.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/slint-ui)
|
|
4
4
|
|
|
5
|
-
[Slint](https://slint
|
|
5
|
+
[Slint](https://slint.dev/) is a UI toolkit that supports different programming languages.
|
|
6
6
|
Slint-node is the integration with node.
|
|
7
7
|
|
|
8
|
-
To get started you can use the [Walk-through tutorial](https://slint
|
|
8
|
+
To get started you can use the [Walk-through tutorial](https://slint.dev/docs/tutorial/node).
|
|
9
9
|
We also have a [Getting Started Template](https://github.com/slint-ui/slint-nodejs-template) repository with
|
|
10
10
|
the code of a minimal application using Slint that can be used as a starting point to your program.
|
|
11
11
|
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright © SixtyFPS GmbH <info@slint
|
|
3
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
2
|
+
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.0 OR LicenseRef-Slint-commercial
|
|
4
4
|
// Load the native library with `process.dlopen` instead of with `require`.
|
|
5
5
|
// This is only done for autotest that do not require nom or neon_cli to
|
|
6
6
|
// copy the lib to its right place
|
package/lib/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Copyright © SixtyFPS GmbH <info@slint
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
1
|
+
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.0 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
// Load the native library with `process.dlopen` instead of with `require`.
|
|
5
5
|
// This is only done for autotest that do not require nom or neon_cli to
|
package/loader.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Copyright © SixtyFPS GmbH <info@slint
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
1
|
+
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.0 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
import { URL, pathToFileURL } from 'url';
|
|
5
5
|
|
package/native/Cargo.toml
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# Copyright © SixtyFPS GmbH <info@slint
|
|
2
|
-
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
1
|
+
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
+
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.0 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
[package]
|
|
5
5
|
name = "slint-node"
|
|
6
|
-
version = "1.0
|
|
7
|
-
authors = ["Slint Developers <info@slint
|
|
6
|
+
version = "1.1.0"
|
|
7
|
+
authors = ["Slint Developers <info@slint.dev>"]
|
|
8
8
|
edition = "2021"
|
|
9
9
|
build = "build.rs"
|
|
10
10
|
# This is not meant to be used as a library from crate.io
|
|
11
11
|
publish = false
|
|
12
|
-
license = "GPL-3.0-only OR LicenseRef-Slint-commercial"
|
|
12
|
+
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.0 OR LicenseRef-Slint-commercial"
|
|
13
13
|
repository = "https://github.com/slint-ui/slint"
|
|
14
|
-
homepage = "https://slint
|
|
14
|
+
homepage = "https://slint.dev"
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
[lib]
|
|
@@ -20,9 +20,9 @@ crate-type = ["cdylib"]
|
|
|
20
20
|
name = "slint_node_native"
|
|
21
21
|
|
|
22
22
|
[dependencies]
|
|
23
|
-
i-slint-compiler = { version = "=1.0
|
|
24
|
-
i-slint-core = { version = "=1.0
|
|
25
|
-
slint-interpreter = { version = "=1.0
|
|
23
|
+
i-slint-compiler = { version = "=1.1.0"}
|
|
24
|
+
i-slint-core = { version = "=1.1.0"}
|
|
25
|
+
slint-interpreter = { version = "=1.1.0", features = ["display-diagnostics"] }
|
|
26
26
|
|
|
27
27
|
vtable = { version = "0.1.6"}
|
|
28
28
|
|
package/native/build.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Copyright © SixtyFPS GmbH <info@slint
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
1
|
+
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.0 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
fn main() {
|
|
5
5
|
neon_build::setup();
|
package/native/js_model.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Copyright © SixtyFPS GmbH <info@slint
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
1
|
+
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.0 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use i_slint_compiler::langtype::Type;
|
|
5
5
|
use i_slint_core::model::Model;
|
package/native/lib.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Copyright © SixtyFPS GmbH <info@slint
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
1
|
+
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.0 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
use core::cell::RefCell;
|
|
5
5
|
use i_slint_compiler::langtype::Type;
|
|
@@ -255,7 +255,8 @@ fn to_js_value<'cx>(
|
|
|
255
255
|
&ImageInner::EmbeddedImage { .. }
|
|
256
256
|
| &ImageInner::StaticTextures { .. }
|
|
257
257
|
| &ImageInner::Svg(..)
|
|
258
|
-
| &ImageInner::BackendStorage(..)
|
|
258
|
+
| &ImageInner::BackendStorage(..)
|
|
259
|
+
| &ImageInner::BorrowedOpenGLTexture(..) => JsNull::new().as_value(cx), // TODO: maybe pass around node buffers?
|
|
259
260
|
},
|
|
260
261
|
Value::Model(model) => {
|
|
261
262
|
if let Some(js_model) = model.as_any().downcast_ref::<js_model::JsModel>() {
|
|
@@ -490,7 +491,9 @@ declare_types! {
|
|
|
490
491
|
let this = cx.this();
|
|
491
492
|
let window = cx.borrow(&this, |x| x.0.as_ref().cloned());
|
|
492
493
|
let window_adapter = window.ok_or(()).or_else(|()| cx.throw_error("Invalid type"))?;
|
|
493
|
-
window_adapter
|
|
494
|
+
if let Some(window_adapter) = window_adapter.internal(i_slint_core::InternalToken) {
|
|
495
|
+
window_adapter.show().unwrap();
|
|
496
|
+
}
|
|
494
497
|
Ok(JsUndefined::new().as_value(&mut cx))
|
|
495
498
|
}
|
|
496
499
|
|
|
@@ -498,7 +501,9 @@ declare_types! {
|
|
|
498
501
|
let this = cx.this();
|
|
499
502
|
let window = cx.borrow(&this, |x| x.0.as_ref().cloned());
|
|
500
503
|
let window_adapter = window.ok_or(()).or_else(|()| cx.throw_error("Invalid type"))?;
|
|
501
|
-
window_adapter
|
|
504
|
+
if let Some(window_adapter) = window_adapter.internal(i_slint_core::InternalToken) {
|
|
505
|
+
window_adapter.hide().unwrap();
|
|
506
|
+
}
|
|
502
507
|
Ok(JsUndefined::new().as_value(&mut cx))
|
|
503
508
|
}
|
|
504
509
|
|
|
@@ -513,7 +518,7 @@ declare_types! {
|
|
|
513
518
|
let this = cx.this();
|
|
514
519
|
let window = cx.borrow(&this, |x| x.0.as_ref().cloned());
|
|
515
520
|
let window_adapter = window.ok_or(()).or_else(|()| cx.throw_error("Invalid type"))?;
|
|
516
|
-
let pos = window_adapter.position().to_logical(window_adapter.window().scale_factor());
|
|
521
|
+
let pos = window_adapter.position().unwrap_or_default().to_logical(window_adapter.window().scale_factor());
|
|
517
522
|
|
|
518
523
|
let point_object = JsObject::new(&mut cx);
|
|
519
524
|
let x_value = JsNumber::new(&mut cx, pos.x).as_value(&mut cx);
|
|
@@ -527,7 +532,7 @@ declare_types! {
|
|
|
527
532
|
let this = cx.this();
|
|
528
533
|
let window = cx.borrow(&this, |x| x.0.as_ref().cloned());
|
|
529
534
|
let window_adapter = window.ok_or(()).or_else(|()| cx.throw_error("Invalid type"))?;
|
|
530
|
-
let pos = window_adapter.position();
|
|
535
|
+
let pos = window_adapter.position().unwrap_or_default();
|
|
531
536
|
|
|
532
537
|
let point_object = JsObject::new(&mut cx);
|
|
533
538
|
let x_value = JsNumber::new(&mut cx, pos.x).as_value(&mut cx);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Copyright © SixtyFPS GmbH <info@slint
|
|
2
|
-
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
1
|
+
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
2
|
+
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.0 OR LicenseRef-Slint-commercial
|
|
3
3
|
|
|
4
4
|
/*!
|
|
5
5
|
Since neon does not allow to have a persistent handle, use this hack.
|