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 | TestCase := Container { |
18 | width: 300phx; |
19 | height: 200phx; |
20 | |
21 | rect1 := Rectangle { |
22 | background: black; |
23 | } |
24 | |
25 | |
26 | property <bool> rect1_pos_ok: rect1.x == 150phx; |
27 | } |
28 | /* |
29 | ```cpp |
30 | auto handle = TestCase::create(); |
31 | const TestCase &instance = *handle; |
32 | assert(instance.get_rect1_pos_ok()); |
33 | ``` |
34 | |
35 | |
36 | ```rust |
37 | let instance = TestCase::new().unwrap(); |
38 | assert!(instance.get_rect1_pos_ok()); |
39 | ``` |
40 | */ |
41 | |