slint/demos/printerdemo_mcu/ui/scan_page.slint
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

81 lines
2.1 KiB
Text

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: MIT
import { DemoPalette, Page, SpinBox, Label, ComboBox, PushButton } from "./common.slint";
import { PrinterQueue } from "./printer_queue.slint";
export component ScanPage inherits Page {
has-back-button: true;
header: "Scan";
GridLayout {
padding-top: 23px /* header line height in design */
+ /* extra top-padding in design */ 13px;
spacing: 5px;
Row {
Text {
text: "Choose Settings";
color: DemoPalette.secondary-foreground-color;
font-size: DemoPalette.base-font-size * 1.125;
font-weight: 800;
}
}
Row {
Label { text: "Copies"; }
SpinBox {
value: 1;
minimum: 1;
}
}
/*Row {
Label { text: "Quality"; }
ComboBox {
value: "Best";
choices: ["Best", "Medium", "Draft"];
}
Rectangle {}
}*/
Row {
Label { text: "Color"; }
ComboBox {
value: "Grayscale";
choices: ["Grayscale", "RGB", "YCMB"];
}
}
Row {
Label { text: "Format"; }
ComboBox {
value: "PDF";
choices: ["PDF", "JPEG", "PNG"];
}
}
Row {
HorizontalLayout {
col: 0;
colspan: 2;
Rectangle {
horizontal-stretch: 0;
width: 10%;
}
PushButton {
icon: @image-url("images/scan.svg");
text: "Start scanning";
clicked => {
PrinterQueue.start-job("Scan");
}
}
Rectangle {
horizontal-stretch: 0;
width: 10%;
}
}
}
Row { Rectangle {} }
}
}