diff --git a/Assets/Bootstrap/LICENSE b/Assets/Bootstrap/LICENSE new file mode 100644 index 0000000..7048e17 --- /dev/null +++ b/Assets/Bootstrap/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-2024 The Bootstrap Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/Assets/Bootstrap/bootstrap-icons.woff2 b/Assets/Bootstrap/bootstrap-icons.woff2 new file mode 100644 index 0000000..4d8c490 Binary files /dev/null and b/Assets/Bootstrap/bootstrap-icons.woff2 differ diff --git a/Commons/Bootstrap.qml b/Commons/Bootstrap.qml index efbac74..8df065c 100644 --- a/Commons/Bootstrap.qml +++ b/Commons/Bootstrap.qml @@ -8,6 +8,39 @@ import qs.Commons Singleton { id: root + // FontLoader for Bootstrap Icons + FontLoader { + id: bootstrapIconsFont + source: Quickshell.shellDir + "/Assets/Bootstrap/bootstrap-icons.woff2" + } + + // 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") + } + } + } + property var icons: { "alarm-fill": "\uF101", "alarm": "\uF102", diff --git a/Widgets/NIcon.qml b/Widgets/NIcon.qml index fedbaa0..5eac4e3 100644 --- a/Widgets/NIcon.qml +++ b/Widgets/NIcon.qml @@ -15,7 +15,7 @@ Text { } return Bootstrap.icons[icon] } - font.family: "bootstrap-icons" + font.family: Bootstrap.fontFamily font.pointSize: Style.fontSizeL * scaling color: Color.mOnSurface verticalAlignment: Text.AlignVCenter