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 | ComboBox := Rectangle { |
6 | min-width: 60px; |
7 | } |
8 | |
9 | SubComp1 := Rectangle { |
10 | HorizontalLayout { |
11 | ComboBox { |
12 | width: 200px; |
13 | } |
14 | } |
15 | } |
16 | |
17 | SubComp2 := HorizontalLayout { |
18 | ComboBox { |
19 | width: 200px; |
20 | } |
21 | } |
22 | |
23 | SubComp3 := HorizontalLayout { |
24 | max-width: 500px; |
25 | Rectangle { } |
26 | } |
27 | |
28 | SubComp4 := SubComp1 {} |
29 | |
30 | |
31 | TestCase := Rectangle { |
32 | width: 300phx; |
33 | height: 300phx; |
34 | |
35 | sc1 := SubComp1 {} |
36 | sc2 := SubComp2 {} |
37 | // FIXME: the HorizontalLayout is required here because the sc3.max-width takes the existing binding instead of being re-materialized |
38 | sc3 := HorizontalLayout { SubComp3 { width: 200px; } } |
39 | sc4 := SubComp4 {} |
40 | property<bool> test: sc1.min-width == 200px && sc2.min-width == 200px && sc3.max-width == 200px && sc4.min-width == 200px; |
41 | } |
42 | } |
43 | |