Refactor icons font wip

This commit is contained in:
LemmyCook 2025-09-09 14:46:11 -04:00
parent b1f9609cd3
commit 43eec0e387
6 changed files with 4954 additions and 39 deletions

View file

@ -4,22 +4,22 @@ import qs.Commons
import qs.Widgets
Text {
readonly property string defaultIcon: "balloon"
property string icon: defaultIcon
property string icon: Icons.defaultIcon
property string family: Icons.fontFamily
visible: (icon !== undefined) && (icon !== "")
text: {
if ((icon === undefined) || (icon === "")) {
return ""
}
if (Bootstrap.icons[icon] === undefined) {
Logger.warn("Icon", `"${icon}"`, "doesn't exist in the bootstrap font")
if (Icons.get(icon) === undefined) {
Logger.warn("Icon", `"${icon}"`, "doesn't exist in the icons font")
Logger.callStack()
return Bootstrap.icons[defaultIcon]
return Icons.get(defaultIcon)
}
return Bootstrap.icons[icon]
return Icons.get(icon)
}
font.family: Bootstrap.fontFamily
font.family: family
font.pointSize: Style.fontSizeL * scaling
color: Color.mOnSurface
verticalAlignment: Text.AlignVCenter