summaryrefslogtreecommitdiff
path: root/components/Icon.qml
blob: a23f6da64ae67e6ebd45620db5901242d774db4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
    color: Colors.foreground2
    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
}