1 | #![allow (deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/layout"# ] |
2 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
3 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
4 | |
5 | TestCase := Window { |
6 | width: 400phx; |
7 | height: 400phx; |
8 | |
9 | GridLayout { |
10 | spacing: 10phx; |
11 | padding: 50phx; |
12 | |
13 | rr := Rectangle { |
14 | background: red; |
15 | row: 0; col: 0; |
16 | colspan: 2; |
17 | max_width: 30phx; |
18 | } |
19 | rb := Rectangle { |
20 | background: blue; |
21 | row: 2; col: 1; |
22 | colspan: 2; |
23 | max_width: 40phx; |
24 | } |
25 | rg := Rectangle { |
26 | background: green; |
27 | row: 3; col: 1; |
28 | horizontal_stretch: 0; |
29 | preferred_width: 20phx; |
30 | } |
31 | ry := Rectangle { |
32 | background: yellow; |
33 | min_height: 200phx; |
34 | col: 3; |
35 | row: 0; |
36 | rowspan: 2; |
37 | horizontal_stretch: 0; |
38 | vertical_stretch: 0; |
39 | } |
40 | } |
41 | |
42 | property <bool> test: { |
43 | rr.x == 50phx && rr.y == 50phx && rr.width == 30phx && rr.height == (200phx - 10phx) / 2 && |
44 | rb.width == 40phx && rg.width == 20phx && rg.height == (400phx - 200phx - 100phx - 20phx) / 2 |
45 | } |
46 | |
47 | } |
48 | } |
49 | |