1 | #![allow (deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/bindings"# ] |
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 | |
6 | RoundedIcon := Rectangle { |
7 | property <float> background-opacity <=> background-fill.opacity; |
8 | background-fill := Rectangle { |
9 | background: #ff7d34; |
10 | opacity: 1.0; |
11 | } |
12 | property <float> o: background-fill.opacity; |
13 | } |
14 | |
15 | Device := VerticalLayout { |
16 | spacing: 5px; |
17 | ri := RoundedIcon { |
18 | background-opacity: 0.15; |
19 | } |
20 | |
21 | property<float> o: ri.o; |
22 | } |
23 | |
24 | Sub := Rectangle { |
25 | property o <=> d.o; |
26 | d := Device {} |
27 | } |
28 | |
29 | |
30 | TestCase := Rectangle { |
31 | s := Sub {} |
32 | d := Device {} |
33 | property o1 <=> s.o; |
34 | property o2 <=> d.o; |
35 | property <bool> test: abs(o1 - 0.15) < 0.001 && abs(o2 - 0.15) < 0.001; |
36 | } |
37 | |
38 | /* |
39 | |
40 | ```rust |
41 | let instance = TestCase::new().unwrap(); |
42 | assert!(instance.get_test()); |
43 | ``` |
44 | |
45 | */ |
46 | } |
47 | |
48 | #[test ] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> { |
49 | use i_slint_backend_testing as slint_testing; |
50 | slint_testing::init(); |
51 | let instance = TestCase::new().unwrap(); |
52 | assert!(instance.get_test()); |
53 | Ok(()) |
54 | } |