summaryrefslogtreecommitdiff
path: root/components/Icon.qml
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-07-13 22:44:02 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-07-13 22:44:02 +0800
commit03a93a60a6c425f5e881bed01feddf7f755624a7 (patch)
tree5676a78966af4036a2c4a7374687d58b864e23df /components/Icon.qml
parent6487f0a1778efc94f192326c1048f3d05d1b408f (diff)
refactor: icons -> icon components
Diffstat (limited to 'components/Icon.qml')
-rw-r--r--components/Icon.qml35
1 files changed, 35 insertions, 0 deletions
diff --git a/components/Icon.qml b/components/Icon.qml
new file mode 100644
index 0000000..a5d2348
--- /dev/null
+++ b/components/Icon.qml
@@ -0,0 +1,35 @@
+import QtQuick
+import QtQuick.Layouts
+
+import qs.config
+
+IText {
+ id: root
+ property real iconSize: General.iconSize
+ property real fill: 0
+ property real truncatedFill: Math.round(fill * 100) / 100 // Reduce memory consumption spikes from constant font remapping
+ renderType: Text.NativeRendering
+ font {
+ // hintingPreference: Font.PreferFullHinting
+ hintingPreference: Font.PreferNoHinting // so the icons dont just offset away
+ family: Style.font.family.symbols ?? "Symbols Nerd Font"
+ pixelSize: iconSize
+ weight: Font.Normal + (Font.DemiBold - Font.Normal) * fill
+ variableAxes: {
+ "FILL": truncatedFill,
+ // "wght": font.weight,
+ // "GRAD": 0,
+ "opsz": iconSize
+ }
+ }
+ verticalAlignment: Text.AlignVCenter
+ // color: Style.m3colors.m3onBackground
+
+ // Behavior on fill {
+ // 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]
+ // }
+ // }
+}