| 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 | export TestCase := Window { |
| 5 | layout1 := VerticalLayout { |
| 6 | if (true) : test1 := VerticalLayout { |
| 7 | Rectangle { height: 55px; } |
| 8 | opacity: 1; |
| 9 | } |
| 10 | } |
| 11 | layout2 := HorizontalLayout { |
| 12 | if (true) : test2 := Rectangle { |
| 13 | inner := VerticalLayout { Rectangle { width: 88px; } } |
| 14 | opacity: 1; |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | layout3 := HorizontalLayout { |
| 19 | for _ in 3 : Rectangle { |
| 20 | width: 10px; |
| 21 | opacity: 0.5; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | // issue #915 |
| 26 | layout4 := HorizontalLayout { |
| 27 | height: 100px; |
| 28 | for _ in 3 : the_image := Image { |
| 29 | width: 10px; |
| 30 | opacity: 0.5; |
| 31 | source: @image-url("../../../logo/slint-logo-square-light-128x128.png" ); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | property <length> layout1_height : layout1.min-height; |
| 36 | property <length> layout2_width : layout2.max-width; |
| 37 | property <length> layout3_width : layout3.preferred-width; |
| 38 | property <length> layout4_width : layout4.preferred-width; |
| 39 | property<bool> test: layout1_height == 55px && layout2_width == 88px && layout3_width == 30px && layout4_width == 30px; |
| 40 | } |
| 41 | |