1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: MIT |
3 | |
4 | import { DemoPalette, Page, SpinBox, Label, ComboBox, PushButton } from "./common.slint" ; |
5 | import { PrinterQueue } from "./printer_queue.slint" ; |
6 | |
7 | export component ScanPage inherits Page { |
8 | has-back-button: true; |
9 | header: @tr("Scan" ); |
10 | |
11 | GridLayout { |
12 | padding-top: 46px /* header line height in design */ |
13 | + /* extra top-padding in design */ 27px; |
14 | spacing: 24px; |
15 | Row { |
16 | Text { |
17 | text: @tr("Choose Settings" ); |
18 | color: DemoPalette.secondary-foreground-color; |
19 | font-size: DemoPalette.base-font-size * 1.125; |
20 | font-weight: 800; |
21 | } |
22 | } |
23 | Row { |
24 | Label { text: @tr("Copies" ); } |
25 | SpinBox { |
26 | value: 1; |
27 | minimum: 1; |
28 | } |
29 | |
30 | Rectangle {} |
31 | |
32 | Label { text: @tr("Size" ); } |
33 | ComboBox { |
34 | value: @tr("Original" ); |
35 | choices: [@tr("Original" ), @tr("A4" )]; |
36 | } |
37 | } |
38 | Row { |
39 | Label { text: @tr("Quality" ); } |
40 | ComboBox { |
41 | value: @tr("Best" ); |
42 | choices: [@tr("Best" ), @tr("Medium" ), @tr("Draft" )]; |
43 | } |
44 | |
45 | Rectangle {} |
46 | |
47 | Label { text: @tr("Format" ); } |
48 | ComboBox { |
49 | value: @tr("PDF" ); |
50 | choices: [@tr("PDF" ), @tr("JPEG" ), @tr("PNG" )]; |
51 | } |
52 | } |
53 | Row { |
54 | Label { text: @tr("Color" ); } |
55 | ComboBox { |
56 | value: @tr("Grayscale" ); |
57 | choices: [@tr("Grayscale" ), @tr("RGB" ), @tr("YCMB" )]; |
58 | } |
59 | |
60 | Rectangle {} |
61 | |
62 | Label { text: @tr("Save to" ); } |
63 | ComboBox { |
64 | value: @tr("Desktop" ); |
65 | choices: [@tr("Desktop" )]; |
66 | } |
67 | } |
68 | Row { |
69 | Rectangle { |
70 | colspan: 3; |
71 | } |
72 | HorizontalLayout { |
73 | col: 3; |
74 | colspan: 2; |
75 | |
76 | Rectangle { |
77 | horizontal-stretch: 0; |
78 | width: 10%; |
79 | } |
80 | PushButton { |
81 | icon: @image-url("images/scan.svg" ); |
82 | text: @tr("Start scanning" ); |
83 | clicked => { |
84 | PrinterQueue.start-job(@tr("Scan" )); |
85 | } |
86 | } |
87 | Rectangle { |
88 | horizontal-stretch: 0; |
89 | width: 10%; |
90 | } |
91 | } |
92 | } |
93 | Row { Rectangle {} } |
94 | } |
95 | } |
96 | |