Fluid 1.3.0
Material Design for QtQuick and Qml
Loading...
Searching...
No Matches
motiontokens.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2// SPDX-License-Identifier: MPL-2.0
3
4#pragma once
5
6#include <QtCore/qobject.h>
7#include <QtQml/qqmlregistration.h>
8
9namespace Fluid {
10
12{
13 Q_GADGET
14 QML_ANONYMOUS
15
16 Q_PROPERTY(qreal x1 MEMBER x1 CONSTANT FINAL)
17 Q_PROPERTY(qreal y1 MEMBER y1 CONSTANT FINAL)
18 Q_PROPERTY(qreal x2 MEMBER x2 CONSTANT FINAL)
19 Q_PROPERTY(qreal y2 MEMBER y2 CONSTANT FINAL)
20
21public:
22 constexpr MotionEasingValue(qreal x1 = 0.0, qreal y1 = 0.0, qreal x2 = 1.0, qreal y2 = 1.0)
23 : x1(x1)
24 , y1(y1)
25 , x2(x2)
26 , y2(y2)
27 {
28 }
29
30 qreal x1;
31 qreal y1;
32 qreal x2;
33 qreal y2;
34};
35
45{
46 Q_GADGET
47 QML_ANONYMOUS
48
49 Q_PROPERTY(qreal extraLong1 READ extraLong1 CONSTANT FINAL)
50 Q_PROPERTY(qreal extraLong2 READ extraLong2 CONSTANT FINAL)
51 Q_PROPERTY(qreal extraLong3 READ extraLong3 CONSTANT FINAL)
52 Q_PROPERTY(qreal extraLong4 READ extraLong4 CONSTANT FINAL)
53 Q_PROPERTY(qreal long1 READ long1 CONSTANT FINAL)
54 Q_PROPERTY(qreal long2 READ long2 CONSTANT FINAL)
55 Q_PROPERTY(qreal long3 READ long3 CONSTANT FINAL)
56 Q_PROPERTY(qreal long4 READ long4 CONSTANT FINAL)
57 Q_PROPERTY(qreal medium1 READ medium1 CONSTANT FINAL)
58 Q_PROPERTY(qreal medium2 READ medium2 CONSTANT FINAL)
59 Q_PROPERTY(qreal medium3 READ medium3 CONSTANT FINAL)
60 Q_PROPERTY(qreal medium4 READ medium4 CONSTANT FINAL)
61 Q_PROPERTY(qreal short1 READ short1 CONSTANT FINAL)
62 Q_PROPERTY(qreal short2 READ short2 CONSTANT FINAL)
63 Q_PROPERTY(qreal short3 READ short3 CONSTANT FINAL)
64 Q_PROPERTY(qreal short4 READ short4 CONSTANT FINAL)
65
66public:
67 constexpr qreal extraLong1() const
68 {
69 return 700.0;
70 }
71 constexpr qreal extraLong2() const
72 {
73 return 800.0;
74 }
75 constexpr qreal extraLong3() const
76 {
77 return 900.0;
78 }
79 constexpr qreal extraLong4() const
80 {
81 return 1000.0;
82 }
83 constexpr qreal long1() const
84 {
85 return 450.0;
86 }
87 constexpr qreal long2() const
88 {
89 return 500.0;
90 }
91 constexpr qreal long3() const
92 {
93 return 550.0;
94 }
95 constexpr qreal long4() const
96 {
97 return 600.0;
98 }
99 constexpr qreal medium1() const
100 {
101 return 250.0;
102 }
103 constexpr qreal medium2() const
104 {
105 return 300.0;
106 }
107 constexpr qreal medium3() const
108 {
109 return 350.0;
110 }
111 constexpr qreal medium4() const
112 {
113 return 400.0;
114 }
115 constexpr qreal short1() const
116 {
117 return 50.0;
118 }
119 constexpr qreal short2() const
120 {
121 return 100.0;
122 }
123 constexpr qreal short3() const
124 {
125 return 150.0;
126 }
127 constexpr qreal short4() const
128 {
129 return 200.0;
130 }
131};
132
142{
143 Q_GADGET
144 QML_ANONYMOUS
145
146 Q_PROPERTY(MotionEasingValue emphasized READ emphasized CONSTANT FINAL)
149 Q_PROPERTY(MotionEasingValue legacy READ legacy CONSTANT FINAL)
152 Q_PROPERTY(MotionEasingValue linear READ linear CONSTANT FINAL)
153 Q_PROPERTY(MotionEasingValue standard READ standard CONSTANT FINAL)
156
157public:
159 {
160 return { 0.2, 0.0, 0.0, 1.0 };
161 }
163 {
164 return { 0.3, 0.0, 0.8, 0.15 };
165 }
167 {
168 return { 0.05, 0.7, 0.1, 1.0 };
169 }
170 constexpr MotionEasingValue legacy() const
171 {
172 return { 0.4, 0.0, 0.2, 1.0 };
173 }
175 {
176 return { 0.4, 0.0, 1.0, 1.0 };
177 }
179 {
180 return { 0.0, 0.0, 0.2, 1.0 };
181 }
182 constexpr MotionEasingValue linear() const
183 {
184 return { 0.0, 0.0, 1.0, 1.0 };
185 }
186 constexpr MotionEasingValue standard() const
187 {
188 return { 0.2, 0.0, 0.0, 1.0 };
189 }
191 {
192 return { 0.3, 0.0, 1.0, 1.0 };
193 }
195 {
196 return { 0.0, 0.0, 0.0, 1.0 };
197 }
198};
199
201{
202 Q_GADGET
203 QML_ANONYMOUS
204
205 Q_PROPERTY(qreal damping MEMBER damping CONSTANT FINAL)
206 Q_PROPERTY(qreal stiffness MEMBER stiffness CONSTANT FINAL)
207
208public:
209 constexpr MotionSpringValue(qreal damping = 1.0, qreal stiffness = 0.0)
212 {
213 }
214
215 qreal damping;
216 qreal stiffness;
217};
218
228{
229 Q_GADGET
230 QML_ANONYMOUS
231
238 Q_PROPERTY(
242 Q_PROPERTY(
246
247public:
249 {
250 return { 0.9, 700.0 };
251 }
253 {
254 return { 0.9, 1400.0 };
255 }
257 {
258 return { 0.9, 300.0 };
259 }
261 {
262 return { 1.0, 1600.0 };
263 }
265 {
266 return { 1.0, 3800.0 };
267 }
269 {
270 return { 1.0, 800.0 };
271 }
273 {
274 return { 0.8, 380.0 };
275 }
277 {
278 return { 0.6, 800.0 };
279 }
281 {
282 return { 0.8, 200.0 };
283 }
285 {
286 return { 1.0, 1600.0 };
287 }
289 {
290 return { 1.0, 3800.0 };
291 }
293 {
294 return { 1.0, 800.0 };
295 }
296};
297
307{
308 Q_GADGET
309 QML_ANONYMOUS
310
311 Q_PROPERTY(MotionDurationTokens duration READ duration CONSTANT FINAL)
312 Q_PROPERTY(MotionEasingTokens easing READ easing CONSTANT FINAL)
313 Q_PROPERTY(MotionSpringTokens spring READ spring CONSTANT FINAL)
314
315public:
317 {
318 return { };
319 }
320 constexpr MotionEasingTokens easing() const
321 {
322 return { };
323 }
324 constexpr MotionSpringTokens spring() const
325 {
326 return { };
327 }
328};
329
330} // namespace Fluid
Material Design 3 duration tokens.
constexpr qreal long3() const
constexpr qreal medium4() const
QML_ANONYMOUSqreal extraLong1
constexpr qreal medium2() const
constexpr qreal long1() const
constexpr qreal long4() const
constexpr qreal medium1() const
constexpr qreal short4() const
constexpr qreal extraLong2() const
constexpr qreal long2() const
constexpr qreal short2() const
constexpr qreal short1() const
constexpr qreal extraLong4() const
constexpr qreal short3() const
constexpr qreal extraLong3() const
constexpr qreal medium3() const
Material Design 3 cubic Bezier easing tokens.
constexpr MotionEasingValue standardDecelerate() const
constexpr MotionEasingValue legacyAccelerate() const
constexpr MotionEasingValue linear() const
MotionEasingValue legacy
MotionEasingValue emphasizedAccelerate
constexpr MotionEasingValue standard() const
constexpr MotionEasingValue legacy() const
MotionEasingValue legacyAccelerate
constexpr MotionEasingValue emphasizedDecelerate() const
constexpr MotionEasingValue legacyDecelerate() const
MotionEasingValue standardAccelerate
MotionEasingValue standardDecelerate
constexpr MotionEasingValue emphasizedAccelerate() const
MotionEasingValue emphasizedDecelerate
QML_ANONYMOUSMotionEasingValue emphasized
constexpr MotionEasingValue standardAccelerate() const
MotionEasingValue linear
MotionEasingValue standard
MotionEasingValue legacyDecelerate
QML_ANONYMOUSqreal x1
Material Design 3 standard and expressive spring tokens.
constexpr MotionSpringValue standardSlowSpatial() const
constexpr MotionSpringValue expressiveDefaultEffects() const
MotionSpringValue expressiveFastSpatial
constexpr MotionSpringValue standardFastSpatial() const
MotionSpringValue expressiveDefaultEffects
constexpr MotionSpringValue expressiveFastEffects() const
MotionSpringValue standardFastEffects
constexpr MotionSpringValue expressiveSlowSpatial() const
constexpr MotionSpringValue expressiveFastSpatial() const
MotionSpringValue standardSlowSpatial
MotionSpringValue expressiveDefaultSpatial
constexpr MotionSpringValue expressiveSlowEffects() const
MotionSpringValue standardSlowEffects
constexpr MotionSpringValue standardFastEffects() const
constexpr MotionSpringValue standardSlowEffects() const
QML_ANONYMOUSMotionSpringValue standardDefaultSpatial
constexpr MotionSpringValue expressiveDefaultSpatial() const
MotionSpringValue standardFastSpatial
MotionSpringValue expressiveSlowSpatial
MotionSpringValue expressiveFastEffects
MotionSpringValue standardDefaultEffects
constexpr MotionSpringValue standardDefaultEffects() const
MotionSpringValue expressiveSlowEffects
QML_ANONYMOUSqreal damping
Material Design 3 system motion tokens.
constexpr MotionEasingTokens easing() const
MotionSpringTokens spring
constexpr MotionSpringTokens spring() const
MotionEasingTokens easing
QML_ANONYMOUSMotionDurationTokens duration