mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-27 13:54:11 +00:00

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.
95 lines
2.6 KiB
Text
95 lines
2.6 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: @tr("Scan");
|
|
|
|
GridLayout {
|
|
padding-top: 46px /* header line height in design */
|
|
+ /* extra top-padding in design */ 27px;
|
|
spacing: 24px;
|
|
Row {
|
|
Text {
|
|
text: @tr("Choose Settings");
|
|
color: DemoPalette.secondary-foreground-color;
|
|
font-size: DemoPalette.base-font-size * 1.125;
|
|
font-weight: 800;
|
|
}
|
|
}
|
|
Row {
|
|
Label { text: @tr("Copies"); }
|
|
SpinBox {
|
|
value: 1;
|
|
minimum: 1;
|
|
}
|
|
|
|
Rectangle {}
|
|
|
|
Label { text: @tr("Size"); }
|
|
ComboBox {
|
|
value: @tr("Original");
|
|
choices: [@tr("Original"), @tr("A4")];
|
|
}
|
|
}
|
|
Row {
|
|
Label { text: @tr("Quality"); }
|
|
ComboBox {
|
|
value: @tr("Best");
|
|
choices: [@tr("Best"), @tr("Medium"), @tr("Draft")];
|
|
}
|
|
|
|
Rectangle {}
|
|
|
|
Label { text: @tr("Format"); }
|
|
ComboBox {
|
|
value: @tr("PDF");
|
|
choices: [@tr("PDF"), @tr("JPEG"), @tr("PNG")];
|
|
}
|
|
}
|
|
Row {
|
|
Label { text: @tr("Color"); }
|
|
ComboBox {
|
|
value: @tr("Grayscale");
|
|
choices: [@tr("Grayscale"), @tr("RGB"), @tr("YCMB")];
|
|
}
|
|
|
|
Rectangle {}
|
|
|
|
Label { text: @tr("Save to"); }
|
|
ComboBox {
|
|
value: @tr("Desktop");
|
|
choices: [@tr("Desktop")];
|
|
}
|
|
}
|
|
Row {
|
|
Rectangle {
|
|
colspan: 3;
|
|
}
|
|
HorizontalLayout {
|
|
col: 3;
|
|
colspan: 2;
|
|
|
|
Rectangle {
|
|
horizontal-stretch: 0;
|
|
width: 10%;
|
|
}
|
|
PushButton {
|
|
icon: @image-url("images/scan.svg");
|
|
text: @tr("Start scanning");
|
|
clicked => {
|
|
PrinterQueue.start-job(@tr("Scan"));
|
|
}
|
|
}
|
|
Rectangle {
|
|
horizontal-stretch: 0;
|
|
width: 10%;
|
|
}
|
|
}
|
|
}
|
|
Row { Rectangle {} }
|
|
}
|
|
}
|