47 Accessible.role: Accessible.Graphic
48 Accessible.ignored: Accessible.name.length === 0
80 property int iconWidth: MD.Tokens.symbol.size
85 property int iconHeight: MD.Tokens.symbol.size
90 property color color: MD.Style.onBackgroundColor
95 property int style: Symbol.Style.Outlined
100 property int weight: Font.Normal
105 property bool fill: false
116 property int grade: Symbol.Grade.NormalEmphasis
123 property int opticalSize: Symbol.OpticalSize.Normal
126 property alias horizontalAlignment: text.horizontalAlignment
129 property alias verticalAlignment: text.verticalAlignment
131 implicitWidth: iconWidth
132 implicitHeight: iconHeight
144 renderType: icon.fill ? Text.NativeRendering : Text.QtRendering
147 switch (icon.style) {
148 case Symbol.Style.Rounded:
149 return MD.Theme.symbolsRoundedFontFamily;
151 return MD.Theme.symbolsSharpFontFamily;
152 case Symbol.Style.Outlined:
154 return MD.Theme.symbolsOutlinedFontFamily;
158 const gradeValues = [-25, 0, 200];
159 const opticalSizes = [20, 24, 40, 48];
161 function closestValue(arr, val) {
164 if (val >= arr[arr.length - 1])
165 return arr[arr.length - 1];
166 for (let i = 0; i < arr.length; ++i) {
170 return arr[arr.length - 1];
174 "FILL": icon.fill ? 1 : 0,
175 "GRAD": closestValue(gradeValues, icon.grade),
176 "opsz": closestValue(opticalSizes, icon.opticalSize)
179 font.pixelSize: Math.max(icon.iconWidth, icon.iconHeight)
180 font.weight: icon.weight
182 horizontalAlignment: Text.AlignHCenter
183 verticalAlignment: Text.AlignVCenter
186 textFormat: Text.PlainText
188 lineHeight: font.pixelSize
189 lineHeightMode: Text.FixedHeight
192 Accessible.ignored:
true
Material Symbols icon tokens.