| 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 | RoundedIcon := Rectangle { |
| 6 | property <float> background-opacity <=> background-fill.opacity; |
| 7 | background-fill := Rectangle { |
| 8 | background: #ff7d34; |
| 9 | opacity: 1.0; |
| 10 | } |
| 11 | property <float> o: background-fill.opacity; |
| 12 | } |
| 13 | |
| 14 | Device := VerticalLayout { |
| 15 | spacing: 5px; |
| 16 | ri := RoundedIcon { |
| 17 | background-opacity: 0.15; |
| 18 | } |
| 19 | |
| 20 | property<float> o: ri.o; |
| 21 | } |
| 22 | |
| 23 | Sub := Rectangle { |
| 24 | property o <=> d.o; |
| 25 | d := Device {} |
| 26 | } |
| 27 | |
| 28 | |
| 29 | TestCase := Rectangle { |
| 30 | s := Sub {} |
| 31 | d := Device {} |
| 32 | property o1 <=> s.o; |
| 33 | property o2 <=> d.o; |
| 34 | property <bool> test: abs(o1 - 0.15) < 0.001 && abs(o2 - 0.15) < 0.001; |
| 35 | } |
| 36 | |
| 37 | /* |
| 38 | |
| 39 | ```rust |
| 40 | let instance = TestCase::new().unwrap(); |
| 41 | assert!(instance.get_test()); |
| 42 | ``` |
| 43 | |
| 44 | */ |
| 45 | |