Fluid 1.3.0
Material Design for QtQuick and Qml
Loading...
Searching...
No Matches
segmentedbutton.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 "measurementtokens.h"
10#include "shapetokens.h"
11#include "statetokens.h"
12#include "typescale.h"
13
14// Generated component values: OutlinedSegmentedButtonTokens.kt, VERSION: v0_162.
15// https://raw.githubusercontent.com/androidx/androidx/androidx-main/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/tokens/OutlinedSegmentedButtonTokens.kt
16// Layout values: SegmentedButtonDefaults.ContentPadding and IconSpacing in:
17// https://raw.githubusercontent.com/androidx/androidx/androidx-main/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SegmentedButton.kt
18// There is no generated disabled-container opacity; the platform retains the
19// selected secondary-container color when disabled. Disabled outline and content
20// map to on-surface in the generated tokens; active colors are resolved by Style.
21
22namespace Fluid {
23
26{
27 Q_GADGET
28 QML_ANONYMOUS
29
30 Q_PROPERTY(qreal containerHeight READ containerHeight CONSTANT FINAL)
31 Q_PROPERTY(qreal iconSize READ iconSize CONSTANT FINAL)
32 Q_PROPERTY(qreal outlineWidth READ outlineWidth CONSTANT FINAL)
33 Q_PROPERTY(Fluid::ShapeValue containerShape READ containerShape CONSTANT FINAL)
34 Q_PROPERTY(Fluid::TypeScaleValue labelTextFont READ labelTextFont CONSTANT FINAL)
35 Q_PROPERTY(qreal disabledContentOpacity READ disabledContentOpacity CONSTANT FINAL)
36 Q_PROPERTY(qreal disabledOutlineOpacity READ disabledOutlineOpacity CONSTANT FINAL)
37 Q_PROPERTY(qreal hoverStateLayerOpacity READ hoverStateLayerOpacity CONSTANT FINAL)
38 Q_PROPERTY(qreal focusStateLayerOpacity READ focusStateLayerOpacity CONSTANT FINAL)
39 Q_PROPERTY(qreal pressedStateLayerOpacity READ pressedStateLayerOpacity CONSTANT FINAL)
40 Q_PROPERTY(qreal contentPadding READ contentPadding CONSTANT FINAL)
41 Q_PROPERTY(qreal contentSpacing READ contentSpacing CONSTANT FINAL)
42 Q_PROPERTY(qreal minimumInteractiveSize READ minimumInteractiveSize CONSTANT FINAL)
43
44public:
46 constexpr qreal containerHeight() const
47 {
48 return 40.0;
49 }
51 constexpr qreal iconSize() const
52 {
53 return 18.0;
54 }
56 constexpr qreal outlineWidth() const
57 {
58 return 1.0;
59 }
61 constexpr ShapeValue containerShape() const
62 {
63 return ShapeTokens{ }.cornerFull();
64 }
68 constexpr qreal disabledContentOpacity() const
69 {
70 return 0.38;
71 }
73 constexpr qreal disabledOutlineOpacity() const
74 {
75 return 0.12;
76 }
78 constexpr qreal hoverStateLayerOpacity() const
79 {
81 }
83 constexpr qreal focusStateLayerOpacity() const
84 {
86 }
88 constexpr qreal pressedStateLayerOpacity() const
89 {
91 }
93 constexpr qreal contentPadding() const
94 {
95 return 12.0;
96 }
98 constexpr qreal contentSpacing() const
99 {
100 return 8.0;
101 }
103 constexpr qreal minimumInteractiveSize() const
104 {
106 }
107};
108
109} // namespace Fluid
Material Design 3 system measurement tokens.
QML_ANONYMOUSqreal minimumInteractiveSize
Material Design 3 outlined segmented-button tokens.
constexpr qreal outlineWidth() const
Thickness of the outline and shared dividers.
constexpr qreal disabledOutlineOpacity() const
Generated opacity of the disabled on-surface outline.
constexpr qreal disabledContentOpacity() const
Generated opacity shared by disabled icons and labels.
constexpr qreal hoverStateLayerOpacity() const
System hover state-layer opacity.
constexpr qreal minimumInteractiveSize() const
Minimum interaction target supplied by the system measurement tokens.
constexpr qreal focusStateLayerOpacity() const
System focus state-layer opacity.
Fluid::TypeScaleValue labelTextFont
QML_ANONYMOUSqreal containerHeight
Fluid::ShapeValue containerShape
constexpr qreal pressedStateLayerOpacity() const
System pressed state-layer opacity.
constexpr ShapeValue containerShape() const
Full system shape applied to the group's outer corners.
constexpr qreal contentSpacing() const
Icon-to-content spacing from the AndroidX platform layout.
constexpr qreal iconSize() const
Size of option icons and the selection indicator.
constexpr qreal contentPadding() const
Horizontal content padding from the AndroidX platform layout.
Material Design 3 system shape tokens.
Definition shapetokens.h:48
Fluid::ShapeValue cornerFull
Definition shapetokens.h:59
Material Design 3 system state tokens.
Definition statetokens.h:18
qreal focusStateLayerOpacity
Definition statetokens.h:23
qreal hoverStateLayerOpacity
Definition statetokens.h:24
qreal pressedStateLayerOpacity
Definition statetokens.h:25
Type scale definition for typography tokens.
Definition typescale.h:30