mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 22:31:14 +00:00
node: added url support to loadFile (#6507)
This commit is contained in:
parent
be2af11a08
commit
f01ac8fc39
13 changed files with 95 additions and 89 deletions
|
@ -3,17 +3,23 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import * as slint from "slint-ui";
|
||||
let demo = slint.loadFile("../ui/printerdemo.slint");
|
||||
let window = new demo.MainWindow();
|
||||
const demo = slint.loadFile(
|
||||
new URL("../ui/printerdemo.slint", import.meta.url),
|
||||
);
|
||||
const window = new demo.MainWindow();
|
||||
|
||||
window.ink_levels = [
|
||||
{ color: "#00ffff", level: 0.30 },
|
||||
{ color: "#ff00ff", level: 0.80 },
|
||||
{ color: "#ffff00", level: 0.60 },
|
||||
{ color: "#000000", level: 0.90 }];
|
||||
{ color: "#00ffff", level: 0.3 },
|
||||
{ color: "#ff00ff", level: 0.8 },
|
||||
{ color: "#ffff00", level: 0.6 },
|
||||
{ color: "#000000", level: 0.9 },
|
||||
];
|
||||
|
||||
window.fax_number_erase = function () {
|
||||
window.fax_number = window.fax_number.substring(0, window.fax_number.length - 1);
|
||||
window.fax_number = window.fax_number.substring(
|
||||
0,
|
||||
window.fax_number.length - 1,
|
||||
);
|
||||
};
|
||||
window.fax_send = function () {
|
||||
console.log("Send fax to " + window.fax_number);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue