fontawesome: fix regular/solid font style

This commit is contained in:
selsta 2019-09-05 00:22:17 +02:00
parent a5b2d5e727
commit 6df9e584b3
5 changed files with 15 additions and 6 deletions

View file

@ -45,6 +45,7 @@ Item {
property alias horizontalAlignment: label.horizontalAlignment property alias horizontalAlignment: label.horizontalAlignment
property alias elide: label.elide property alias elide: label.elide
property alias textWidth: label.width property alias textWidth: label.width
property alias styleName: label.font.styleName
property alias themeTransition: label.themeTransition property alias themeTransition: label.themeTransition
signal linkActivated() signal linkActivated()
height: label.height height: label.height

View file

@ -107,7 +107,7 @@ Rectangle {
image: MoneroComponents.Style.titleBarExpandSource image: MoneroComponents.Style.titleBarExpandSource
color: MoneroComponents.Style.defaultFontColor color: MoneroComponents.Style.defaultFontColor
fontAwesomeFallbackIcon: FontAwesome.cube fontAwesomeFallbackIcon: FontAwesome.cube
fontAwesomeFallbackSize: 14 fontAwesomeFallbackSize: 16
fontAwesomeFallbackOpacity: MoneroComponents.Style.blackTheme ? 1.0 : 0.9 fontAwesomeFallbackOpacity: MoneroComponents.Style.blackTheme ? 1.0 : 0.9
opacity: 0.75 opacity: 0.75
} }
@ -131,9 +131,10 @@ Rectangle {
Text { Text {
text: FontAwesome.globe text: FontAwesome.globe
font.family: FontAwesome.fontFamily font.family: FontAwesome.fontFamilySolid
font.pixelSize: 16 font.pixelSize: 16
color: MoneroComponents.Style.defaultFontColor color: MoneroComponents.Style.defaultFontColor
font.styleName: "Solid"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
opacity: 0.75 opacity: 0.75
@ -158,6 +159,7 @@ Rectangle {
Text { Text {
text: FontAwesome.moonO text: FontAwesome.moonO
font.family: MoneroComponents.Style.blackTheme ? FontAwesome.fontFamilySolid : FontAwesome.fontFamily font.family: MoneroComponents.Style.blackTheme ? FontAwesome.fontFamilySolid : FontAwesome.fontFamily
font.styleName: MoneroComponents.Style.blackTheme ? "Solid" : "Regular"
font.pixelSize: 16 font.pixelSize: 16
color: MoneroComponents.Style.defaultFontColor color: MoneroComponents.Style.defaultFontColor
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter

View file

@ -41,6 +41,8 @@ Item {
property string color: "" property string color: ""
property bool fontAwesomeFallbackEnabled: true property bool fontAwesomeFallbackEnabled: true
property var fontAwesomeFallbackIcon: "" property var fontAwesomeFallbackIcon: ""
property string fontAwesomeFallbackFont: FontAwesome.fontFamilySolid
property string fontAwesomeFallbackStyle: "Solid"
property int fontAwesomeFallbackSize: 16 property int fontAwesomeFallbackSize: 16
property double fontAwesomeFallbackOpacity: 0.8 property double fontAwesomeFallbackOpacity: 0.8
property string fontAwesomeFallbackColor: MoneroComponents.Style.defaultFontColor property string fontAwesomeFallbackColor: MoneroComponents.Style.defaultFontColor
@ -74,8 +76,9 @@ Item {
id: fontAwesomeFallback id: fontAwesomeFallback
visible: !isOpenGL && root.fontAwesomeFallback visible: !isOpenGL && root.fontAwesomeFallback
text: !isOpenGL ? root.fontAwesomeFallbackIcon : "" text: !isOpenGL ? root.fontAwesomeFallbackIcon : ""
font.family: FontAwesome.fontFamily font.family: root.fontAwesomeFallbackFont
font.pixelSize: root.fontAwesomeFallbackSize font.pixelSize: root.fontAwesomeFallbackSize
font.styleName: root.fontAwesomeFallbackStyle
color: root.fontAwesomeFallbackColor color: root.fontAwesomeFallbackColor
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View file

@ -4,6 +4,7 @@ import QtQuick 2.9
Object { Object {
FontLoader { FontLoader {
id: regular
source: "./fa-regular-400.ttf" source: "./fa-regular-400.ttf"
} }
@ -17,7 +18,7 @@ Object {
source: "./fa-solid-900.ttf" source: "./fa-solid-900.ttf"
} }
property string fontFamily: "FontAwesome" property string fontFamily: regular.name
property string fontFamilyBrands: brands.name property string fontFamilyBrands: brands.name
property string fontFamilySolid: solid.name property string fontFamilySolid: solid.name

View file

@ -99,9 +99,10 @@ Rectangle{
MoneroComponents.Label { MoneroComponents.Label {
fontSize: 32 fontSize: 32
text: FontAwesome.home text: FontAwesome.home
fontFamily: FontAwesome.fontFamily fontFamily: FontAwesome.fontFamilySolid
anchors.centerIn: parent anchors.centerIn: parent
fontColor: MoneroComponents.Style.defaultFontColor fontColor: MoneroComponents.Style.defaultFontColor
styleName: "Solid"
} }
} }
@ -200,7 +201,8 @@ Rectangle{
MoneroComponents.Label { MoneroComponents.Label {
fontSize: 28 fontSize: 28
text: FontAwesome.cloud text: FontAwesome.cloud
fontFamily: FontAwesome.fontFamily fontFamily: FontAwesome.fontFamilySolid
styleName: "Solid"
anchors.centerIn: parent anchors.centerIn: parent
fontColor: MoneroComponents.Style.defaultFontColor fontColor: MoneroComponents.Style.defaultFontColor
} }