Fluid 1.3.0
Material Design for QtQuick and Qml
Loading...
Searching...
No Matches
exposeddropdownmenu.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
9#include "elevationtokens.h"
10#include "shapetokens.h"
11
12// Component values map to the AndroidX Material 3 generated tokens, VERSION: v0_210:
13// https://android.googlesource.com/platform/frameworks/support/+/5ba2cdd61be7b6945db999b238d14f3c626136fb/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/
14// FilledAutocompleteTokens.kt and OutlinedAutocompleteTokens.kt.
15
16namespace Fluid {
17
20{
21 Q_GADGET
22 QML_ANONYMOUS
23
24 Q_PROPERTY(qreal fieldHeight READ fieldHeight CONSTANT FINAL)
25 Q_PROPERTY(qreal minimumWidth READ minimumWidth CONSTANT FINAL)
26 Q_PROPERTY(qreal preferredWidth READ preferredWidth CONSTANT FINAL)
27 Q_PROPERTY(qreal horizontalPadding READ horizontalPadding CONSTANT FINAL)
28 Q_PROPERTY(qreal contentVerticalPadding READ contentVerticalPadding CONSTANT FINAL)
29 Q_PROPERTY(qreal labelInputTextSpace READ labelInputTextSpace CONSTANT FINAL)
30 Q_PROPERTY(qreal supportingTextTopSpace READ supportingTextTopSpace CONSTANT FINAL)
32 Q_PROPERTY(qreal filledLeadingIconSize READ filledLeadingIconSize CONSTANT FINAL)
33 Q_PROPERTY(qreal filledActiveIndicatorHeight READ filledActiveIndicatorHeight CONSTANT FINAL)
35 FINAL)
37 FINAL)
38 Q_PROPERTY(
41 Q_PROPERTY(qreal outlinedLeadingIconSize READ outlinedLeadingIconSize CONSTANT FINAL)
42 Q_PROPERTY(qreal outlinedOutlineWidth READ outlinedOutlineWidth CONSTANT FINAL)
43 Q_PROPERTY(qreal outlinedHoverOutlineWidth READ outlinedHoverOutlineWidth CONSTANT FINAL)
44 Q_PROPERTY(qreal outlinedFocusOutlineWidth READ outlinedFocusOutlineWidth CONSTANT FINAL)
45 Q_PROPERTY(
47 Q_PROPERTY(
49 Q_PROPERTY(qreal trailingIconSize READ trailingIconSize CONSTANT FINAL)
50 Q_PROPERTY(qreal leadingIconContentSpace READ leadingIconContentSpace CONSTANT FINAL)
51 Q_PROPERTY(qreal trailingIconContentSpace READ trailingIconContentSpace CONSTANT FINAL)
52 Q_PROPERTY(qreal disabledContentOpacity READ disabledContentOpacity CONSTANT FINAL)
53 Q_PROPERTY(qreal popupAnchorGap READ popupAnchorGap CONSTANT FINAL)
55 Q_PROPERTY(qreal popupContainerElevation READ popupContainerElevation CONSTANT FINAL)
56
57public:
59 constexpr qreal fieldHeight() const
60 {
61 return 56.0;
62 }
64 constexpr qreal minimumWidth() const
65 {
66 return 280.0;
67 }
69 constexpr qreal preferredWidth() const
70 {
71 return 280.0;
72 }
74 constexpr qreal horizontalPadding() const
75 {
76 return 16.0;
77 }
79 constexpr qreal contentVerticalPadding() const
80 {
81 return 8.0;
82 }
84 constexpr qreal labelInputTextSpace() const
85 {
86 return 4.0;
87 }
89 constexpr qreal supportingTextTopSpace() const
90 {
91 return 4.0;
92 }
95 {
97 }
99 constexpr qreal filledLeadingIconSize() const
100 {
101 return 20.0;
102 }
104 constexpr qreal filledActiveIndicatorHeight() const
105 {
106 return 1.0;
107 }
109 constexpr qreal filledHoverActiveIndicatorHeight() const
110 {
111 return 1.0;
112 }
114 constexpr qreal filledFocusActiveIndicatorHeight() const
115 {
116 return 2.0;
117 }
119 constexpr qreal filledDisabledContainerOpacity() const
120 {
121 return 0.04;
122 }
125 {
126 return ShapeTokens{ }.cornerExtraSmall();
127 }
129 constexpr qreal outlinedLeadingIconSize() const
130 {
131 return 24.0;
132 }
134 constexpr qreal outlinedOutlineWidth() const
135 {
136 return 1.0;
137 }
139 constexpr qreal outlinedHoverOutlineWidth() const
140 {
141 return 1.0;
142 }
144 constexpr qreal outlinedFocusOutlineWidth() const
145 {
146 return 2.0;
147 }
149 constexpr qreal outlinedDisabledOutlineOpacity() const
150 {
151 return 0.12;
152 }
154 constexpr qreal outlinedLabelHorizontalPadding() const
155 {
156 return 4.0;
157 }
159 constexpr qreal trailingIconSize() const
160 {
161 return 24.0;
162 }
164 constexpr qreal leadingIconContentSpace() const
165 {
166 return 16.0;
167 }
169 constexpr qreal trailingIconContentSpace() const
170 {
171 return 12.0;
172 }
174 constexpr qreal disabledContentOpacity() const
175 {
176 return 0.38;
177 }
179 constexpr qreal popupAnchorGap() const
180 {
181 return 4.0;
182 }
185 {
186 return ShapeTokens{ }.cornerLarge();
187 }
189 constexpr qreal popupContainerElevation() const
190 {
191 return ElevationTokens{ }.level2();
192 }
193};
194
195} // namespace Fluid
Material Design 3 system elevation tokens.
Material Design 3 tokens for exposed dropdown menus.
constexpr qreal outlinedLabelHorizontalPadding() const
Surface-backed horizontal padding around a floated outlined-field label.
constexpr qreal outlinedHoverOutlineWidth() const
Hovered thickness of the field outline.
constexpr qreal horizontalPadding() const
Logical outer padding of field content.
constexpr qreal filledFocusActiveIndicatorHeight() const
Focused thickness of the filled active indicator.
constexpr ShapeValue outlinedContainerShape() const
Shape of the outlined field container.
constexpr qreal trailingIconSize() const
Size of the dropdown indicator icon.
constexpr qreal outlinedFocusOutlineWidth() const
Focused thickness of the field outline.
constexpr qreal outlinedLeadingIconSize() const
Size of the optional leading icon in an outlined field.
constexpr qreal trailingIconContentSpace() const
Space between text content and the dropdown indicator.
constexpr qreal preferredWidth() const
Preferred field width.
Fluid::ShapeValue filledContainerShape
constexpr qreal disabledContentOpacity() const
Opacity of disabled field content.
constexpr qreal filledHoverActiveIndicatorHeight() const
Hovered thickness of the filled active indicator.
constexpr qreal leadingIconContentSpace() const
Space between a leading icon and text content.
constexpr qreal outlinedOutlineWidth() const
Resting thickness of the field outline.
constexpr ShapeValue filledContainerShape() const
Shape of the filled field container.
constexpr qreal outlinedDisabledOutlineOpacity() const
Opacity of the outline when disabled.
constexpr ShapeValue popupContainerShape() const
Shape of the popup surface.
Fluid::ShapeValue popupContainerShape
constexpr qreal contentVerticalPadding() const
Vertical padding used by text inside the field.
constexpr qreal minimumWidth() const
Minimum supported field width.
Fluid::ShapeValue outlinedContainerShape
constexpr qreal filledDisabledContainerOpacity() const
Opacity of the filled container when disabled.
constexpr qreal popupContainerElevation() const
Elevation of the popup surface.
constexpr qreal labelInputTextSpace() const
Space between a floated label and input text.
constexpr qreal supportingTextTopSpace() const
Space above supporting or error text.
constexpr qreal popupAnchorGap() const
Vertical distance between the field and popup.
constexpr qreal filledLeadingIconSize() const
Size of the optional leading icon in a filled field.
constexpr qreal filledActiveIndicatorHeight() const
Resting thickness of the filled active indicator.
Material Design 3 system shape tokens.
Definition shapetokens.h:48
Fluid::ShapeValue cornerLarge
Definition shapetokens.h:60
Fluid::ShapeValue cornerExtraSmall
Definition shapetokens.h:57
Fluid::ShapeValue cornerExtraSmallTop
Definition shapetokens.h:58