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