| 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: "Scan" ; |
| 10 | |
| 11 | GridLayout { |
| 12 | padding-top: 23px /* header line height in design */ |
| 13 | + /* extra top-padding in design */ 13px; |
| 14 | spacing: 5px; |
| 15 | Row { |
| 16 | Text { |
| 17 | text: "Choose Settings" ; |
| 18 | color: DemoPalette.secondary-foreground-color; |
| 19 | font-size: DemoPalette.base-font-size * 1.125; |
| 20 | font-weight: 800; |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | Row { |
| 25 | Label { text: "Copies" ; } |
| 26 | SpinBox { |
| 27 | value: 1; |
| 28 | minimum: 1; |
| 29 | } |
| 30 | } |
| 31 | /*Row { |
| 32 | Label { text: "Quality"; } |
| 33 | ComboBox { |
| 34 | value: "Best"; |
| 35 | choices: ["Best", "Medium", "Draft"]; |
| 36 | } |
| 37 | Rectangle {} |
| 38 | }*/ |
| 39 | Row { |
| 40 | Label { text: "Color" ; } |
| 41 | ComboBox { |
| 42 | value: "Grayscale" ; |
| 43 | choices: ["Grayscale" , "RGB" , "YCMB" ]; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | Row { |
| 48 | Label { text: "Format" ; } |
| 49 | ComboBox { |
| 50 | value: "PDF" ; |
| 51 | choices: ["PDF" , "JPEG" , "PNG" ]; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | Row { |
| 56 | HorizontalLayout { |
| 57 | col: 0; |
| 58 | colspan: 2; |
| 59 | |
| 60 | |
| 61 | Rectangle { |
| 62 | horizontal-stretch: 0; |
| 63 | width: 10%; |
| 64 | } |
| 65 | PushButton { |
| 66 | icon: @image-url("images/scan.svg" ); |
| 67 | text: "Start scanning" ; |
| 68 | clicked => { |
| 69 | PrinterQueue.start-job("Scan" ); |
| 70 | } |
| 71 | } |
| 72 | Rectangle { |
| 73 | horizontal-stretch: 0; |
| 74 | width: 10%; |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | Row { Rectangle {} } |
| 79 | |
| 80 | } |
| 81 | } |
| 82 | |