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// SLINT_SCALE_FACTOR=1.5
5
6export global ZeroHelper {
7 in property<float> zero: 0;
8}
9
10export component TestCase inherits Window {
11 width: 64phx;
12 height: 64phx;
13 Rectangle {
14 x: 1.49999997px;
15 y: 1.5px;
16 width: 15.33px;
17 height: 15.33px;
18 clip: true;
19 background: pink;
20 Text {
21 text: "Hello\nWorld";
22 font-size: 9.5px;
23 color: black;
24 horizontal-alignment: center;
25 vertical-alignment: center;
26 }
27 }
28
29 Rectangle {
30 x: 17.333px;
31 y: 1.5px;
32 width: 15.33px;
33 height: 24.18px;
34 clip: true;
35 background: orange;
36 opacity: 0.9;
37 Text {
38 height: 133%;
39 width: 121%;
40 text: "Three\nLines\nText";
41 font-size: 9px;
42 color: blue;
43 font-weight: 600;
44 font-italic: true;
45 horizontal-alignment: right;
46 }
47 }
48
49 Rectangle {
50 x: 33.5px;
51 y: 1.1px;
52 width: 28.33px;
53 height: 25.9px;
54 clip: true;
55 background: lightblue;
56 property <percent> dd;
57 Text {
58 height: 100%; width: 100%;
59 text: "Word wrap and right Align";
60 wrap: word-wrap;
61 horizontal-alignment: right;
62 vertical-alignment: bottom;
63 font-size: 9.1px;
64 color: violet;
65 }
66 }
67
68 Text {
69 height: 99%; width: 99%;
70 y: 2.499997px;
71 x: -20.49997px;
72 text: "Some long text bottom-right-aligned";
73 wrap: word-wrap;
74 overflow: elide;
75 horizontal-alignment: right;
76 vertical-alignment: bottom;
77 font-size: 9px;
78 color: violet;
79 }
80
81
82 Text {
83 height: 99%; width: 99%;
84 y: 2.499997px;
85 x: -20.49997px;
86 text: "Some long text bottom-right-aligned";
87 wrap: word-wrap;
88 overflow: elide;
89 horizontal-alignment: right;
90 vertical-alignment: bottom;
91 font-size: 9px;
92 color: violet;
93 }
94
95 Rectangle {
96 background: #8234;
97 x: 38.788px;
98 y: 30.123px;
99 width: 30px;
100 height: 30px;
101 clip: true;
102 Text {
103 y: -2.5px;
104 x: -2.5px;
105 width: 110%;
106 height: 110%;
107 property <string> t: "tiny tiny text nobody can see\nhelloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\n this is soooo smallllllllllllllllllll and so tiny"
108 +" \nnobody can read this anyway.";
109 text: t+t+t+t;
110
111 wrap: word-wrap;
112 overflow: elide;
113 horizontal-alignment: left;
114 font-size: 4px;
115 letter-spacing: -1px;
116
117 color: green;
118 }
119 }
120
121 Text {
122 text: "Zero";
123 x: ZeroHelper.zero * 5px / ZeroHelper.zero;
124 }
125
126
127}
128