slint/demos/printerdemo/node/main.js
Simon Hausmann a98d4709be Move printer demo and energy-monitor into new top-level demos/ folder
These are showing off use-cases for Slint, but they're not examples showing individual Slint features.

Also removed the old printerdemo while at it.
2024-10-25 12:09:32 +02:00

21 lines
534 B
JavaScript
Executable file

#!/usr/bin/env node
// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: MIT
import * as slint from "slint-ui";
slint.initTranslations("printerdemo", new URL("../lang/", import.meta.url));
const demo = slint.loadFile(
new URL("../ui/printerdemo.slint", import.meta.url),
);
const window = new demo.MainWindow();
window.ink_levels = [
{ color: "#00ffff", level: 0.3 },
{ color: "#ff00ff", level: 0.8 },
{ color: "#ffff00", level: 0.6 },
{ color: "#000000", level: 0.9 },
];
window.run();