1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: MIT
3
4import { DemoPalette, Page, SpinBox, Label, ComboBox, PushButton, CheckBox } from "./common.slint";
5import { PrinterQueue } from "./printer_queue.slint";
6
7
8export component CopyPage inherits Page {
9 has-back-button: true;
10 header: @tr("Copy");
11
12 GridLayout {
13 padding-top: 46px /* header line height in design */
14 + /* extra top-padding in design */ 27px;
15 spacing: 24px;
16 Row {
17 Text {
18 text: @tr("Choose Settings");
19 color: DemoPalette.secondary-foreground-color;
20 font-size: DemoPalette.base-font-size * 1.125;
21 font-weight: 800;
22 }
23 }
24 Row {
25 Label { text: @tr("Copies"); }
26 SpinBox {
27 value: 1;
28 minimum: 1;
29 }
30
31 Rectangle {}
32
33 Label { text: @tr("Size"); }
34 ComboBox {
35 value: @tr("DIN A4");
36 choices: [@tr("DIN A4"), @tr("DIN A3"), @tr("Letter")];
37 }
38 }
39 Row {
40 Label { text: @tr("Layout"); }
41 ComboBox {
42 value: @tr("Portrait");
43 choices: [@tr("Portrait"), @tr("Landscape")];
44 }
45
46 Rectangle {}
47
48 Label { text: @tr("Paper Tray"); }
49 ComboBox {
50 value: @tr("Special Tray");
51 choices: [@tr("Special Tray"), @tr("Normal Tray")];
52 }
53 }
54 Row {
55 Label { text: @tr("Quality"); }
56 ComboBox {
57 value: @tr("Best");
58 choices: [@tr("Best"), @tr("Medium"), @tr("Draft")];
59 }
60
61 Rectangle {}
62
63 Label { text: @tr("Paper Type"); }
64 ComboBox {
65 value: @tr("Standard");
66 choices: [@tr("Standard"), @tr("Non-standard")];
67 }
68 }
69 Row {
70 Label { text: @tr("Color"); }
71 ComboBox {
72 value: @tr("Grayscale");
73 choices: [@tr("Grayscale"), @tr("Color")];
74 }
75
76 Rectangle {}
77
78 Label { text: @tr("Paper Handling"); }
79 CheckBox {
80 checked: true;
81 text: @tr("Sort Pages");
82 }
83 }
84 Row {
85 HorizontalLayout {
86 col: 3;
87 colspan: 2;
88
89 Rectangle {
90 horizontal-stretch: 0;
91 width: 10%;
92 }
93 PushButton {
94 icon: @image-url("images/copy.svg");
95 text: @tr("Start copying");
96 clicked => {
97 PrinterQueue.start-job(@tr("Copy"));
98 }
99 }
100 Rectangle {
101 horizontal-stretch: 0;
102 width: 10%;
103 }
104 }
105 }
106 Row { Rectangle {} }
107 }
108}
109