| 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 | |
| 5 | component C1 { |
| 6 | Rectangle { |
| 7 | min-width: 200px; |
| 8 | min-height: 300px; |
| 9 | inner := Rectangle {} |
| 10 | } |
| 11 | } |
| 12 | component C2 { |
| 13 | Rectangle { |
| 14 | min-width: 200px; |
| 15 | min-height: 300px; |
| 16 | inner := Rectangle { width: 100%; } |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | component FillParent { |
| 21 | preferred-height: 100%; |
| 22 | preferred-width: 100%; |
| 23 | min-height: l.min-height; |
| 24 | min-width: l.min-width; |
| 25 | |
| 26 | l := VerticalLayout { |
| 27 | Text {} |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | export component Bug6315 { |
| 32 | r := Rectangle { |
| 33 | width: self.preferred-width; |
| 34 | r2 := Rectangle { |
| 35 | preferred-width: 100px; |
| 36 | Rectangle { |
| 37 | preferred-width: 40px; |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | Text { |
| 43 | text: ( |
| 44 | "\{r.width / 1px}, " + |
| 45 | "\{r2.width / 1px}, " + |
| 46 | "" |
| 47 | ); |
| 48 | } |
| 49 | out property <bool> ok: r.width == 100px && r2.width == 100px; |
| 50 | } |
| 51 | |
| 52 | |
| 53 | export component W inherits Window { |
| 54 | |
| 55 | Rectangle { |
| 56 | VerticalLayout { |
| 57 | FillParent { |
| 58 | min-height: self.preferred-height; |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | c1:= C1 {} |
| 64 | c2:= C2 {} |
| 65 | |
| 66 | bug-6315 := Bug6315 {} |
| 67 | |
| 68 | |
| 69 | out property <bool> test: c1.min-height == 300px && c1.min-width == 200px |
| 70 | && c2.min-height == 300px && c2.min-width == 200px |
| 71 | && bug-6315.ok; |
| 72 | } |