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

40
Commons/Icons.qml Normal file
View file

@ -0,0 +1,40 @@
pragma Singleton
import QtQuick
import QtQuick.Controls
import Quickshell
import qs.Commons
import qs.Commons.IconsSets
Singleton {
id: root
// Expose the font family name for easy access
readonly property string fontFamily: fontLoader.name
readonly property string defaultIcon: Bootstrap.defaultIcon
Component.onCompleted: {
Logger.log("Icons", "Service started")
}
function get(iconName) {
return Bootstrap.icons[iconName]
}
FontLoader {
id: fontLoader
source: Quickshell.shellDir + "/Assets/Fonts/bootstrap/bootstrap-icons.woff2"
}
// Monitor font loading status
Connections {
target: fontLoader
function onStatusChanged() {
if (fontLoader.status === FontLoader.Ready) {
Logger.log("Bootstrap", "Font loaded successfully:", fontFamily)
} else if (fontLoader.status === FontLoader.Error) {
Logger.error("Bootstrap", "Font failed to load")
}
}
}
}

View file

@ -1,44 +1,15 @@
pragma Singleton
import QtQuick
import QtQuick.Controls
import Quickshell
import qs.Commons
Singleton {
id: root
// FontLoader for Bootstrap Icons
FontLoader {
id: bootstrapIconsFont
source: Quickshell.shellDir + "/Assets/Bootstrap/bootstrap-icons.woff2"
}
readonly property string defaultIcon: "balloon"
// Expose the font family name for easy access
readonly property string fontFamily: bootstrapIconsFont.name
// Check if font is loaded
readonly property bool fontLoaded: bootstrapIconsFont.status === FontLoader.Ready
Component.onCompleted: {
Logger.log("Bootstrap", "Service started")
if (fontLoaded) {
Logger.log("Bootstrap", "Font loaded successfully:", fontFamily)
} else {
Logger.warn("Bootstrap", "Font failed to load")
}
}
// Monitor font loading status
Connections {
target: bootstrapIconsFont
function onStatusChanged() {
if (bootstrapIconsFont.status === FontLoader.Ready) {
Logger.log("Bootstrap", "Font loaded successfully:", fontFamily)
} else if (bootstrapIconsFont.status === FontLoader.Error) {
Logger.error("Bootstrap", "Font failed to load")
}
}
readonly property var aliases: {
"close": "x-lg"
}
readonly property var icons: {

4904
Commons/IconsSets/Tabler.qml Normal file

File diff suppressed because it is too large Load diff