| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | ComboBox := Rectangle { |
| 5 | min-width: 60px; |
| 6 | } |
| 7 | |
| 8 | SubComp1 := Rectangle { |
| 9 | HorizontalLayout { |
| 10 | ComboBox { |
| 11 | width: 200px; |
| 12 | } |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | SubComp2 := HorizontalLayout { |
| 17 | ComboBox { |
| 18 | width: 200px; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | SubComp3 := HorizontalLayout { |
| 23 | max-width: 500px; |
| 24 | Rectangle { } |
| 25 | } |
| 26 | |
| 27 | SubComp4 := SubComp1 {} |
| 28 | |
| 29 | |
| 30 | TestCase := Rectangle { |
| 31 | width: 300phx; |
| 32 | height: 300phx; |
| 33 | |
| 34 | sc1 := SubComp1 {} |
| 35 | sc2 := SubComp2 {} |
| 36 | // FIXME: the HorizontalLayout is required here because the sc3.max-width takes the existing binding instead of being re-materialized |
| 37 | sc3 := HorizontalLayout { SubComp3 { width: 200px; } } |
| 38 | sc4 := SubComp4 {} |
| 39 | property<bool> test: sc1.min-width == 200px && sc2.min-width == 200px && sc3.max-width == 200px && sc4.min-width == 200px; |
| 40 | } |
| 41 | |