1#![allow(deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/properties"#]
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
5component Slider {
6 in-out property <int> value;
7 TouchArea {
8 clicked => { value += 1; }
9 }
10}
11
12export global Glob { in-out property <bool> cond; }
13
14component Animated {
15 public function animate() {
16 r.x += 500px;
17 }
18
19 in property <easing> ease;
20 in property <int> duration;
21 in property <duration> delay;
22 r := Rectangle {
23 background: Glob.cond ? blue : red;
24 animate background { easing: ease; duration: duration * 1ms; }
25 animate x { easing: ease; duration: 260ms; delay: delay; }
26 }
27}
28
29export component Main {
30 slider1 := Slider {}
31 slider2 := Slider {}
32 property <int> value1: slider1.value;
33 property <int> value2: slider2.value;
34 public function anunimate() { a1.animate(); }
35 HorizontalLayout {
36 a1 := Animated { ease: ease-out; duration: value1; delay: value2 * 2ms; }
37 Animated { ease: ease-in; duration: value1; delay: value2 * 2ms; }
38 }
39}
40}
41