Files
illogical-impulse/dots/.config/quickshell/ii/modules/common/widgets/MaterialSymbol.qml
T
2025-10-16 07:19:55 +08:00

31 lines
1.1 KiB
QML

import qs.modules.common
import QtQuick
StyledText {
id: root
property real iconSize: Appearance?.font.pixelSize.small ?? 16
property real fill: 0
property real truncatedFill: fill.toFixed(1) // Reduce memory consumption spikes from constant font remapping
renderType: fill !== 0 ? Text.CurveRendering : Text.NativeRendering
font {
hintingPreference: Font.PreferFullHinting
family: Appearance?.font.family.iconMaterial ?? "Material Symbols Rounded"
pixelSize: iconSize
weight: Font.Normal + (Font.DemiBold - Font.Normal) * truncatedFill
variableAxes: {
"FILL": truncatedFill,
// "wght": font.weight,
// "GRAD": 0,
"opsz": iconSize,
}
}
Behavior on fill { // Leaky leaky, no good
NumberAnimation {
duration: Appearance?.animation.elementMoveFast.duration ?? 200
easing.type: Appearance?.animation.elementMoveFast.type ?? Easing.BezierSpline
easing.bezierCurve: Appearance?.animation.elementMoveFast.bezierCurve ?? [0.34, 0.80, 0.34, 1.00, 1, 1]
}
}
}