1#![allow(deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/examples"#]
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// This should render as a rectangle with a black border and
6// green "fill".
7
8export Test := Window {
9 background: white;
10
11 TouchArea {
12 clicked => { r.clip = !r.clip; }
13 }
14
15 r:= Rectangle {
16 x: 50px;
17 y: 50px;
18 width: 300px;
19 height: 300px;
20 border-radius: 25px;
21 border-width: 20px;
22 border-color: black;
23
24 clip: true;
25
26 Rectangle {
27 x: -20px;
28 y: -20px;
29 width: parent.width + 20px;
30 height: parent.height + 20px;
31 background: green;
32 }
33
34 Text {
35 color: blue;
36 y: 10px;
37 text: "This Text is clipped";
38 font-size: 24px;
39 }
40
41 Rectangle {
42 x: 150px;
43 y: 150px;
44 width: 200px;
45 height: 200px;
46 background: red;
47 }
48
49 Image {
50 source: @image-url("../../../logo/slint-logo-square-light-128x128.png");
51 y: 50px;
52 x: -30px;
53 }
54 }
55}
56}
57