BootstrapIcons: bundle font with noctalia, use fontloader
This commit is contained in:
parent
144406ae0e
commit
5042d4d747
4 changed files with 55 additions and 1 deletions
21
Assets/Bootstrap/LICENSE
Normal file
21
Assets/Bootstrap/LICENSE
Normal file
|
|
@ -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.
|
||||
BIN
Assets/Bootstrap/bootstrap-icons.woff2
Normal file
BIN
Assets/Bootstrap/bootstrap-icons.woff2
Normal file
Binary file not shown.
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue