Basic bootstrap icons test
This commit is contained in:
parent
b639c3632d
commit
ed78b6b3f5
4 changed files with 22 additions and 11 deletions
|
|
@ -33,7 +33,7 @@ NIconButton {
|
||||||
readonly property bool useDistroLogo: (widgetSettings.useDistroLogo
|
readonly property bool useDistroLogo: (widgetSettings.useDistroLogo
|
||||||
!== undefined) ? widgetSettings.useDistroLogo : widgetMetadata.useDistroLogo
|
!== undefined) ? widgetSettings.useDistroLogo : widgetMetadata.useDistroLogo
|
||||||
|
|
||||||
icon: useDistroLogo ? "" : "widgets"
|
icon: useDistroLogo ? "" : "\ue30d"
|
||||||
tooltipText: "Open side panel."
|
tooltipText: "Open side panel."
|
||||||
sizeRatio: 0.8
|
sizeRatio: 0.8
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,17 @@ Singleton {
|
||||||
property ListModel displayFonts: ListModel {}
|
property ListModel displayFonts: ListModel {}
|
||||||
property bool fontsLoaded: false
|
property bool fontsLoaded: false
|
||||||
|
|
||||||
|
property var icons: {
|
||||||
|
"sunny": "\ue30d",
|
||||||
|
"partly_cloudy": "\ue302",
|
||||||
|
"cloud": "\ue312",
|
||||||
|
"foggy": "\ue311",
|
||||||
|
"rainy": "\ue318"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
Logger.log("Font", "Service started")
|
Logger.log("Font", "Service started")
|
||||||
loadSystemFonts()
|
loadSystemFonts()
|
||||||
|
|
|
||||||
|
|
@ -231,22 +231,22 @@ Singleton {
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
function weatherSymbolFromCode(code) {
|
function weatherSymbolFromCode(code) {
|
||||||
if (code === 0)
|
if (code === 0)
|
||||||
return "sunny"
|
return FontService.icons["sunny"]
|
||||||
if (code === 1 || code === 2)
|
if (code === 1 || code === 2)
|
||||||
return "partly_cloudy_day"
|
return FontService.icons["partly_cloudy"]
|
||||||
if (code === 3)
|
if (code === 3)
|
||||||
return "cloud"
|
return FontService.icons["cloud"]
|
||||||
if (code >= 45 && code <= 48)
|
if (code >= 45 && code <= 48)
|
||||||
return "foggy"
|
return FontService.icons["foggy"]
|
||||||
if (code >= 51 && code <= 67)
|
if (code >= 51 && code <= 67)
|
||||||
return "rainy"
|
return FontService.icons["rainy"]
|
||||||
if (code >= 71 && code <= 77)
|
if (code >= 71 && code <= 77)
|
||||||
return "weather_snowy"
|
return FontService.icons["weather_snowy"]
|
||||||
if (code >= 80 && code <= 82)
|
if (code >= 80 && code <= 82)
|
||||||
return "rainy"
|
return FontService.icons["rainy"]
|
||||||
if (code >= 95 && code <= 99)
|
if (code >= 95 && code <= 99)
|
||||||
return "thunderstorm"
|
return FontService.icons["thunderstorm"]
|
||||||
return "cloud"
|
return FontService.icons["cloud"]
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ Text {
|
||||||
// Optional layout nudge for optical alignment when used inside Layouts
|
// Optional layout nudge for optical alignment when used inside Layouts
|
||||||
property real layoutTopMargin: 0
|
property real layoutTopMargin: 0
|
||||||
text: "question_mark"
|
text: "question_mark"
|
||||||
font.family: "Material Symbols Rounded"
|
font.family: "bootstrap-icons"
|
||||||
font.pointSize: Style.fontSizeL * scaling
|
font.pointSize: Style.fontSizeL * scaling
|
||||||
font.variableAxes: {
|
font.variableAxes: {
|
||||||
"wght"// slightly bold to ensure all lines looks good
|
"wght"// slightly bold to ensure all lines looks good
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue