fix: use fontStyle for MaterialIcon

This commit is contained in:
2 * r + 2 * t 2026-04-21 01:48:03 +10:00
parent 9de9e7ec98
commit f69abecfa2
3 changed files with 20 additions and 1 deletions

View file

@ -1,9 +1,11 @@
import QtQuick
import Caelestia.Config
import qs.services
StyledText {
property real fill
property int grade: Colours.light ? 0 : -25
property font fontStyle
font: Tokens.font.icon.builders.large.vaxis("FILL", fill.toFixed(1)).vaxis("GRAD", grade).vaxis("opsz", fontInfo.pixelSize).vaxis("wght", fontInfo.weight).build()
font: Tokens.font.icon.builder.size(fontStyle.pointSize).weight(fontStyle.weight).fill(fill.toFixed(1)).grade(grade).build()
}

View file

@ -51,4 +51,16 @@ QFont FontBuilder::build() const {
return m_font;
}
FontBuilder FontBuilder::fill(float value) {
return vaxis("FILL", value);
}
FontBuilder FontBuilder::grade(float value) {
return vaxis("GRAD", value);
}
FontBuilder FontBuilder::width(float value) {
return vaxis("wdth", value);
}
} // namespace caelestia::config

View file

@ -23,6 +23,11 @@ public:
[[nodiscard]] Q_INVOKABLE FontBuilder vaxis(QFont::Tag tag, float value);
[[nodiscard]] Q_INVOKABLE QFont build() const;
// Common vaxes
[[nodiscard]] Q_INVOKABLE FontBuilder fill(float value);
[[nodiscard]] Q_INVOKABLE FontBuilder grade(float value);
[[nodiscard]] Q_INVOKABLE FontBuilder width(float value);
private:
QFont m_font;
};