1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
3 | |
4 | Container := Rectangle { |
5 | GridLayout { |
6 | padding: 0phx; |
7 | spacing: 0phx; |
8 | Row { |
9 | Rectangle { |
10 | background: green; |
11 | } |
12 | @children |
13 | } |
14 | } |
15 | } |
16 | |
17 | MegaContainer := Rectangle { |
18 | Container { |
19 | @children |
20 | width: parent.width; |
21 | height: parent.height; |
22 | } |
23 | } |
24 | |
25 | TestCase := MegaContainer { |
26 | width: 300phx; |
27 | height: 200phx; |
28 | |
29 | rect1 := Rectangle { |
30 | background: black; |
31 | } |
32 | |
33 | |
34 | property <bool> rect1_pos_ok: rect1.x == 150phx; |
35 | } |
36 | /* |
37 | ```cpp |
38 | auto handle = TestCase::create(); |
39 | const TestCase &instance = *handle; |
40 | assert(instance.get_rect1_pos_ok()); |
41 | ``` |
42 | |
43 | |
44 | ```rust |
45 | let instance = TestCase::new().unwrap(); |
46 | assert!(instance.get_rect1_pos_ok()); |
47 | ``` |
48 | */ |
49 | |