QmlMaterial 0.1.0
Loading...
Searching...
No Matches
segmented_button.hpp
1#pragma once
2
3#include <QtQml/QQmlEngine>
4#include "qml_material/core.hpp"
5#include "qml_material/export.hpp"
6
7namespace qml_material::token
8{
9
17 Q_GADGET_EXPORT(QML_MATERIAL_API)
18 QML_ELEMENT
19 QML_VALUE_TYPE(segmented_button_size_item)
20
21
22 Q_PROPERTY(qreal container_height MEMBER container_height CONSTANT FINAL)
24 Q_PROPERTY(qreal icon_size MEMBER icon_size CONSTANT FINAL)
26 Q_PROPERTY(qreal leading_space MEMBER leading_space CONSTANT FINAL)
28 Q_PROPERTY(qreal trailing_space MEMBER trailing_space CONSTANT FINAL)
30 Q_PROPERTY(qreal icon_label_space MEMBER icon_label_space CONSTANT FINAL)
32 Q_PROPERTY(qreal outline_width MEMBER outline_width CONSTANT FINAL)
33
34public:
35 qreal container_height;
36 qreal icon_size;
37 qreal leading_space;
38 qreal trailing_space;
39 qreal icon_label_space;
40 qreal outline_width;
41 bool operator==(const SegmentedButtonSizeItem&) const = default;
42};
43
48 Q_GADGET_EXPORT(QML_MATERIAL_API)
49 QML_ELEMENT
50 QML_VALUE_TYPE(segmented_button_size)
51
52 Q_PROPERTY(qml_material::token::SegmentedButtonSizeItem xsmall MEMBER xsmall CONSTANT FINAL)
53 Q_PROPERTY(qml_material::token::SegmentedButtonSizeItem small MEMBER small CONSTANT FINAL)
54 Q_PROPERTY(qml_material::token::SegmentedButtonSizeItem medium MEMBER medium CONSTANT FINAL)
55 Q_PROPERTY(qml_material::token::SegmentedButtonSizeItem large MEMBER large CONSTANT FINAL)
56 Q_PROPERTY(qml_material::token::SegmentedButtonSizeItem xlarge MEMBER xlarge CONSTANT FINAL)
57
58public:
59 bool operator==(const SegmentedButtonSize&) const = default;
61 32.0, // container_height
62 20.0, // icon_size
63 12.0, // leading_space
64 12.0, // trailing_space
65 8.0, // icon_label_space
66 1.0 // outline_width
67 };
69 40.0, // container_height
70 20.0, // icon_size
71 16.0, // leading_space
72 16.0, // trailing_space
73 8.0, // icon_label_space
74 1.0 // outline_width
75 };
77 56.0, // container_height
78 24.0, // icon_size
79 24.0, // leading_space
80 24.0, // trailing_space
81 8.0, // icon_label_space
82 1.0 // outline_width
83 };
85 96.0, // container_height
86 32.0, // icon_size
87 48.0, // leading_space
88 48.0, // trailing_space
89 12.0, // icon_label_space
90 2.0 // outline_width
91 };
93 136.0, // container_height
94 40.0, // icon_size
95 64.0, // leading_space
96 64.0, // trailing_space
97 16.0, // icon_label_space
98 3.0 // outline_width
99 };
100};
101
102} // namespace qml_material::token
Segmented button size tokens for a specific size class.
Definition segmented_button.hpp:16
qreal leading_space
Leading space / padding-start (dp)
Definition segmented_button.hpp:26
qreal icon_label_space
Spacing between icon and label (dp)
Definition segmented_button.hpp:30
qreal trailing_space
Trailing space / padding-end (dp)
Definition segmented_button.hpp:28
qreal icon_size
Icon size (dp)
Definition segmented_button.hpp:24
qreal outline_width
Outlined variant outline width (dp)
Definition segmented_button.hpp:32
qreal container_height
Segment container height (dp)
Definition segmented_button.hpp:22
Collection of segmented button size tokens for different size classes.
Definition segmented_button.hpp:47