| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: MIT |
| 3 | |
| 4 | import { DemoPalette, Page, SpinBox, ComboBox, CheckBox, Label } from "common.slint" ; |
| 5 | |
| 6 | export component SettingsPage inherits Page { |
| 7 | header: "Settings" ; |
| 8 | |
| 9 | GridLayout { |
| 10 | padding-top: 23px /* header line height in design */ |
| 11 | + /* extra top-padding in design */ 13px; |
| 12 | spacing: 5px; |
| 13 | Row { |
| 14 | Text { |
| 15 | text: "Defaults" ; |
| 16 | color: DemoPalette.secondary-foreground-color; |
| 17 | font-size: DemoPalette.base-font-size * 1.125; |
| 18 | font-weight: 800; |
| 19 | colspan: 2; |
| 20 | horizontal-stretch: 2; |
| 21 | } |
| 22 | Rectangle {} |
| 23 | Text { |
| 24 | col: 3; |
| 25 | colspan: 2; |
| 26 | text: "General" ; |
| 27 | color: DemoPalette.secondary-foreground-color; |
| 28 | font-size: DemoPalette.base-font-size * 1.125; |
| 29 | font-weight: 800; |
| 30 | } |
| 31 | } |
| 32 | Row { |
| 33 | Label { text: "Layout" ; } |
| 34 | ComboBox { |
| 35 | value: "Portrait" ; |
| 36 | choices: ["Portrait" , "Landscape" ]; |
| 37 | horizontal-stretch: 2; |
| 38 | } |
| 39 | Rectangle {} |
| 40 | Label { |
| 41 | text: "EcoMode" ; |
| 42 | TouchArea { clicked => { cb1.checked = !cb1.checked; } } |
| 43 | } |
| 44 | cb1 := CheckBox { checked: false; } |
| 45 | } |
| 46 | Row { |
| 47 | Label { text: "Quality" ; } |
| 48 | ComboBox { |
| 49 | value: "Best" ; |
| 50 | choices: ["Best" , "Medium" , "Draft" ]; |
| 51 | horizontal-stretch: 2; |
| 52 | } |
| 53 | Rectangle {} |
| 54 | Label { |
| 55 | text: "TURBO " ; |
| 56 | TouchArea { clicked => { cb2.checked = !cb2.checked; } } |
| 57 | } |
| 58 | cb2 := CheckBox { checked: true; } |
| 59 | } |
| 60 | Row { |
| 61 | Label { text: "Color" ; } |
| 62 | ComboBox { |
| 63 | value: "Grayscale" ; |
| 64 | choices: ["Grayscale" , "Color" ]; |
| 65 | horizontal-stretch: 2; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | Rectangle {} |
| 70 | |
| 71 | } |
| 72 | Image { |
| 73 | source: DemoPalette.night-mode ? @image-url("slint-logo-square-dark-80x80.png" ) : @image-url("slint-logo-square-light-80x80.png" ); |
| 74 | width: 80px; |
| 75 | height: 80px; |
| 76 | x: parent.width - self.width; |
| 77 | y: parent.height - self.height; |
| 78 | } |
| 79 | } |
| 80 | |