slint-ui 1.6.0-nightly.2024040900 → 1.6.0-nightly.2024041607

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/.yarnrc.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  # Copyright © SixtyFPS GmbH <info@slint.dev>
2
- # SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ # SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  nodeLinker: node-modules
package/Cargo.toml CHANGED
@@ -1,5 +1,5 @@
1
1
  # Copyright © SixtyFPS GmbH <info@slint.dev>
2
- # SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ # SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  [package]
5
5
  name = "slint-node"
@@ -9,7 +9,7 @@ documentation = "https://slint.dev/docs"
9
9
  edition = "2021"
10
10
  homepage = "https://slint.dev"
11
11
  keywords = ["gui", "toolkit", "graphics", "design", "ui"]
12
- license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial"
12
+ license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial"
13
13
  repository = "https://github.com/slint-ui/slint"
14
14
  rust-version = "1.73"
15
15
  version = "1.6.0"
@@ -40,10 +40,10 @@ accessibility = ["slint-interpreter/accessibility"]
40
40
  [dependencies]
41
41
  napi = { version = "2.14.0", default-features = false, features = ["napi8"] }
42
42
  napi-derive = "2.14.0"
43
- i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "d863893e62e699f1debf8cc19ced8c31b9d83150", version = "=1.6.0", default-features = false }
44
- i-slint-core = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "d863893e62e699f1debf8cc19ced8c31b9d83150", version = "=1.6.0", default-features = false }
45
- i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "d863893e62e699f1debf8cc19ced8c31b9d83150", version = "=1.6.0", default-features = false }
46
- slint-interpreter = { default-features = false, features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "d863893e62e699f1debf8cc19ced8c31b9d83150", version = "=1.6.0", default_features = false }
43
+ i-slint-compiler = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "63f1114ff238fea3ba14c9d96470b8fed5b46193", version = "=1.6.0", default-features = false }
44
+ i-slint-core = { features = ["default"] , git = "https://github.com/slint-ui/slint", rev = "63f1114ff238fea3ba14c9d96470b8fed5b46193", version = "=1.6.0", default-features = false }
45
+ i-slint-backend-selector = { git = "https://github.com/slint-ui/slint", rev = "63f1114ff238fea3ba14c9d96470b8fed5b46193", version = "=1.6.0", default-features = false }
46
+ slint-interpreter = { default-features = false, features = ["display-diagnostics", "internal", "compat-1-2"] , git = "https://github.com/slint-ui/slint", rev = "63f1114ff238fea3ba14c9d96470b8fed5b46193", version = "=1.6.0", default_features = false }
47
47
  spin_on = "0.1"
48
48
  css-color-parser2 = { version = "1.0.1" }
49
49
  itertools = { version = "0.12" }
package/LICENSE.md CHANGED
@@ -1,10 +1,10 @@
1
- <!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial -->
1
+ <!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial -->
2
2
 
3
3
  # Slint License
4
4
 
5
5
  You can use Slint under ***any*** of the following licenses, at your choice:
6
6
 
7
- 1. [Royalty-free license](LICENSES/LicenseRef-Slint-Royalty-free-1.1.md),
7
+ 1. [Royalty-free license](LICENSES/LicenseRef-Slint-Royalty-free-1.2.md),
8
8
  2. [GNU GPLv3](LICENSES/GPL-3.0-only.txt),
9
9
  3. [Commercial license](LICENSES/LicenseRef-Slint-commercial.md).
10
10
 
@@ -1,32 +1,36 @@
1
- # Slint Royalty-free Desktop and Web Applications License, version 1.1
1
+ # Slint Royalty-free Desktop, Mobile, and Web Applications License v1.2
2
2
 
3
3
  ## Preamble
4
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.
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, Mobile, and Web Applications License" is suitable for those who develop desktop, mobile, or web applications and do not want to use open source components under copyleft licenses.
6
6
 
7
7
  ### 1. Grant of Rights
8
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.
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, Mobile, or Web Application.
10
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.
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.
12
12
 
13
- Desktop Application and Web Application are hereafter referred to as "Application".
13
+ A Mobile Application is a computer program that is designed to run on a general-purpose mobile computer (mobile phone or tablet), typically installed and executed locally on the computer's operating system.
14
14
 
15
- ### 2. Limitations
15
+ A Web Application is a computer program that is running on a server and accessed using a web browser or client program.
16
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.
17
+ Desktop Application, Mobile Application, and Web Application are hereafter referred to as "Application".
20
18
 
21
- ### 3. License Conditions - Attribution
19
+ ### 2. License Conditions - Attribution
22
20
 
23
- You may distribute the Software as part of an Application, modified or unmodified, provided that You do all of the following:
21
+ You may distribute the Software as part of an Application, modified or unmodified, provided that You do either of the following:
24
22
 
25
- (a) Display the [`AboutSlint`](https://slint.dev/snapshots/master/docs/slint/src/language/widgets/aboutslint.html) widget in an "About" screen or dialog that is accessible from the top level menu of the Application.
23
+ (a) Display the [`AboutSlint`](https://slint.dev/snapshots/master/docs/slint/src/language/widgets/aboutslint.html) widget in an "About" screen or dialog that is accessible from the top level menu of the Application. In the absence of such a screen or dialog, display the widget in the "Splash Screen" of the Application.
26
24
 
27
25
  (b) Display the [Slint attribution badge](https://github.com/slint-ui/slint/tree/master/logo/MadeWithSlint-logo-whitebg.png) 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
26
 
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.
27
+ ### 3. Limitations
28
+
29
+ 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.
30
+
31
+ 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.
32
+
33
+ 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
34
 
31
35
  ### 4. Warranty and Liability
32
36
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial -->
1
+ <!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial -->
2
2
 
3
3
  # Slint-node (Beta)
4
4
 
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  // This file checks if a binary package was installed (through architecture dependencies), and
5
5
  // builds slint if no binary was found.
package/build.rs CHANGED
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  fn main() {
5
5
  napi_build::setup();
package/index.d.ts CHANGED
@@ -586,4 +586,5 @@ export declare namespace private_api {
586
586
  export import SlintImageData = napi.SlintImageData;
587
587
  function send_mouse_click(component: Component, x: number, y: number): void;
588
588
  function send_keyboard_string_sequence(component: Component, s: string): void;
589
+ export import initTesting = napi.initTesting;
589
590
  }
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  // Copyright © SixtyFPS GmbH <info@slint.dev>
3
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
3
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.quitEventLoop = exports.runEventLoop = exports.loadSource = exports.loadFile = exports.CompileError = exports.private_api = exports.ArrayModel = exports.Model = void 0;
6
6
  const napi = require("./rust-module.cjs");
@@ -751,4 +751,5 @@ exports.quitEventLoop = quitEventLoop;
751
751
  component.component_instance.sendKeyboardStringSequence(s);
752
752
  }
753
753
  private_api.send_keyboard_string_sequence = send_keyboard_string_sequence;
754
+ private_api.initTesting = napi.initTesting;
754
755
  })(private_api || (exports.private_api = private_api = {}));
package/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  import * as napi from "./rust-module.cjs";
5
5
  export {
@@ -1039,4 +1039,6 @@ export namespace private_api {
1039
1039
  ) {
1040
1040
  component.component_instance.sendKeyboardStringSequence(s);
1041
1041
  }
1042
+
1043
+ export import initTesting = napi.initTesting;
1042
1044
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slint-ui",
3
- "version": "1.6.0-nightly.2024040900",
3
+ "version": "1.6.0-nightly.2024041607",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "homepage": "https://github.com/slint-ui/slint",
@@ -37,6 +37,7 @@
37
37
  "compile": "tsc",
38
38
  "build": "napi build --platform --release --js rust-module.cjs --dts rust-module.d.ts -c binaries.json",
39
39
  "build:debug": "napi build --platform --js rust-module.cjs --dts rust-module.d.ts -c binaries.json && npm run compile",
40
+ "build:testing": "napi build --platform --js rust-module.cjs --dts rust-module.d.ts -c binaries.json --features testing && npm run compile",
40
41
  "install": "node build-on-demand.mjs",
41
42
  "docs": "npm run build && typedoc --hideGenerator --treatWarningsAsErrors --readme cover.md index.ts",
42
43
  "test": "ava"
@@ -58,10 +59,10 @@
58
59
  "@napi-rs/cli": "^2.16.5"
59
60
  },
60
61
  "optionalDependencies": {
61
- "@slint-ui/slint-ui-binary-linux-x64-gnu": "1.6.0-nightly.2024040900",
62
- "@slint-ui/slint-ui-binary-darwin-x64": "1.6.0-nightly.2024040900",
63
- "@slint-ui/slint-ui-binary-darwin-arm64": "1.6.0-nightly.2024040900",
64
- "@slint-ui/slint-ui-binary-win32-x64-msvc": "1.6.0-nightly.2024040900",
65
- "@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.6.0-nightly.2024040900"
62
+ "@slint-ui/slint-ui-binary-linux-x64-gnu": "1.6.0-nightly.2024041607",
63
+ "@slint-ui/slint-ui-binary-darwin-x64": "1.6.0-nightly.2024041607",
64
+ "@slint-ui/slint-ui-binary-darwin-arm64": "1.6.0-nightly.2024041607",
65
+ "@slint-ui/slint-ui-binary-win32-x64-msvc": "1.6.0-nightly.2024041607",
66
+ "@slint-ui/slint-ui-binary-win32-ia32-msvc": "1.6.0-nightly.2024041607"
66
67
  }
67
68
  }
package/rust-module.cjs CHANGED
@@ -224,17 +224,32 @@ switch (platform) {
224
224
  }
225
225
  break
226
226
  case 'arm':
227
- localFileExisted = existsSync(
228
- join(__dirname, 'index.linux-arm-gnueabihf.node')
229
- )
230
- try {
231
- if (localFileExisted) {
232
- nativeBinding = require('./index.linux-arm-gnueabihf.node')
233
- } else {
234
- nativeBinding = require('@slint-ui/slint-ui-binary-linux-arm-gnueabihf')
227
+ if (isMusl()) {
228
+ localFileExisted = existsSync(
229
+ join(__dirname, 'index.linux-arm-musleabihf.node')
230
+ )
231
+ try {
232
+ if (localFileExisted) {
233
+ nativeBinding = require('./index.linux-arm-musleabihf.node')
234
+ } else {
235
+ nativeBinding = require('@slint-ui/slint-ui-binary-linux-arm-musleabihf')
236
+ }
237
+ } catch (e) {
238
+ loadError = e
239
+ }
240
+ } else {
241
+ localFileExisted = existsSync(
242
+ join(__dirname, 'index.linux-arm-gnueabihf.node')
243
+ )
244
+ try {
245
+ if (localFileExisted) {
246
+ nativeBinding = require('./index.linux-arm-gnueabihf.node')
247
+ } else {
248
+ nativeBinding = require('@slint-ui/slint-ui-binary-linux-arm-gnueabihf')
249
+ }
250
+ } catch (e) {
251
+ loadError = e
235
252
  }
236
- } catch (e) {
237
- loadError = e
238
253
  }
239
254
  break
240
255
  case 'riscv64':
@@ -295,7 +310,7 @@ if (!nativeBinding) {
295
310
  throw new Error(`Failed to load native binding`)
296
311
  }
297
312
 
298
- const { DiagnosticLevel, ComponentCompiler, ComponentDefinition, ComponentInstance, ValueType, Property, Window, SlintRgbaColor, SlintBrush, SlintImageData, SharedModelNotify, jsModelNotifyNew, jsModelNotifyRowDataChanged, jsModelNotifyRowAdded, jsModelNotifyRowRemoved, jsModelNotifyReset, ReadOnlyRustModel, ModelIterator, SlintPoint, SlintSize, mockElapsedTime, getMockedTime, ProcessEventsResult, processEvents, invokeFromEventLoop, setQuitOnLastWindowClosed } = nativeBinding
313
+ const { DiagnosticLevel, ComponentCompiler, ComponentDefinition, ComponentInstance, ValueType, Property, Window, SlintRgbaColor, SlintBrush, SlintImageData, SharedModelNotify, jsModelNotifyNew, jsModelNotifyRowDataChanged, jsModelNotifyRowAdded, jsModelNotifyRowRemoved, jsModelNotifyReset, ReadOnlyRustModel, ModelIterator, SlintPoint, SlintSize, mockElapsedTime, getMockedTime, ProcessEventsResult, processEvents, invokeFromEventLoop, setQuitOnLastWindowClosed, initTesting } = nativeBinding
299
314
 
300
315
  module.exports.DiagnosticLevel = DiagnosticLevel
301
316
  module.exports.ComponentCompiler = ComponentCompiler
@@ -323,3 +338,4 @@ module.exports.ProcessEventsResult = ProcessEventsResult
323
338
  module.exports.processEvents = processEvents
324
339
  module.exports.invokeFromEventLoop = invokeFromEventLoop
325
340
  module.exports.setQuitOnLastWindowClosed = setQuitOnLastWindowClosed
341
+ module.exports.initTesting = initTesting
package/rust-module.d.ts CHANGED
@@ -82,6 +82,7 @@ export const enum ProcessEventsResult {
82
82
  export function processEvents(): ProcessEventsResult
83
83
  export function invokeFromEventLoop(callback: (...args: any[]) => any): void
84
84
  export function setQuitOnLastWindowClosed(quitOnLastWindowClosed: boolean): void
85
+ export function initTesting(): void
85
86
  export type JsComponentCompiler = ComponentCompiler
86
87
  /**
87
88
  * ComponentCompiler is the entry point to the Slint interpreter that can be used
@@ -232,8 +233,9 @@ export class SlintRgbaColor {
232
233
  */
233
234
  transparentize(amount: number): SlintRgbaColor
234
235
  /**
235
- * Returns a new color that is a mix of `self` and `other`, with a proportion
236
- * factor given by `factor` (which will be clamped to be between `0.0` and `1.0`).
236
+ * Returns a new color that is a mix of `this` color and `other`. The specified factor is
237
+ * clamped to be between `0.0` and `1.0` and then applied to `this` color, while `1.0 - factor`
238
+ *is applied to `other`.
237
239
  */
238
240
  mix(other: SlintRgbaColor, factor: number): SlintRgbaColor
239
241
  /** Returns a new version of this color with the opacity set to `alpha`. */
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use std::collections::HashMap;
5
5
  use std::path::PathBuf;
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use napi::Result;
5
5
  use slint_interpreter::ComponentDefinition;
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use i_slint_compiler::langtype::Type;
5
5
  use i_slint_core::window::WindowInner;
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use slint_interpreter::{Diagnostic, DiagnosticLevel};
5
5
 
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use crate::{
5
5
  js_into_rust_model, rust_into_js_model, ReadOnlyRustModel, RgbaColor, SlintBrush,
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use crate::types::{SlintPoint, SlintSize};
5
5
  use i_slint_core::window::WindowAdapterRc;
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  mod diagnostic;
5
5
  pub use diagnostic::*;
package/src/lib.rs CHANGED
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  mod interpreter;
5
5
  pub use interpreter::*;
@@ -76,3 +76,10 @@ pub fn set_quit_on_last_window_closed(
76
76
  }
77
77
  env.get_undefined()
78
78
  }
79
+
80
+ #[napi]
81
+ pub fn init_testing()
82
+ {
83
+ #[cfg(feature = "testing")]
84
+ i_slint_backend_testing::init_with_event_loop();
85
+ }
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use i_slint_core::{graphics::GradientStop, Brush, Color};
5
5
  use napi::{bindgen_prelude::External, Error, Result};
@@ -142,8 +142,9 @@ impl SlintRgbaColor {
142
142
  SlintRgbaColor::from(self.inner.transparentize(amount as f32))
143
143
  }
144
144
 
145
- /// Returns a new color that is a mix of `self` and `other`, with a proportion
146
- /// factor given by `factor` (which will be clamped to be between `0.0` and `1.0`).
145
+ /// Returns a new color that is a mix of `this` color and `other`. The specified factor is
146
+ /// clamped to be between `0.0` and `1.0` and then applied to `this` color, while `1.0 - factor`
147
+ ///is applied to `other`.
147
148
  #[napi]
148
149
  pub fn mix(&self, other: &SlintRgbaColor, factor: f64) -> SlintRgbaColor {
149
150
  SlintRgbaColor::from(self.inner.mix(&other.inner, factor as f32))
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use std::vec;
5
5
 
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use std::rc::Rc;
5
5
 
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use napi::{
5
5
  bindgen_prelude::{FromNapiValue, Object},
package/src/types/size.rs CHANGED
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  use napi::{
5
5
  bindgen_prelude::{FromNapiValue, Object},
package/src/types.rs CHANGED
@@ -1,5 +1,5 @@
1
1
  // Copyright © SixtyFPS GmbH <info@slint.dev>
2
- // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
2
+ // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial
3
3
 
4
4
  mod brush;
5
5
  pub use brush::*;