From f900e7c00ea2dbace1f6270d390a583a02248fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blak?= Date: Thu, 15 Sep 2022 17:23:51 +0200 Subject: [PATCH] fix(general): buttons font fixed, font loading refactored Fixes: #7389 --- ui/StatusQ | 2 +- .../controls/AccountViewDelegate.qml | 2 +- .../views/EnsTermsAndConditionsView.qml | 4 ++-- .../Wallet/controls/HeaderButton.qml | 2 +- .../Wallet/panels/SeedPhraseBackupWarning.qml | 2 +- ui/imports/Themes/Theme.qml | 20 ++++++++++--------- .../shared/controls/RecipientSelector.qml | 4 ++-- ui/imports/shared/controls/StyledTextArea.qml | 2 +- ui/imports/shared/controls/StyledTextEdit.qml | 2 +- .../shared/controls/StyledTextField.qml | 2 +- ui/imports/shared/panels/Address.qml | 2 +- ui/imports/shared/panels/ModuleWarning.qml | 2 +- ui/imports/shared/panels/StyledText.qml | 2 +- ui/imports/shared/panels/TextWithLabel.qml | 2 +- ui/imports/shared/status/StatusChatInput.qml | 2 +- .../shared/status/StatusExpandableAddress.qml | 2 +- .../shared/status/StatusStickerButton.qml | 4 ++-- .../status/StatusStickerPackDetails.qml | 4 ++-- 18 files changed, 32 insertions(+), 30 deletions(-) diff --git a/ui/StatusQ b/ui/StatusQ index a94d9338bf..d892a84227 160000 --- a/ui/StatusQ +++ b/ui/StatusQ @@ -1 +1 @@ -Subproject commit a94d9338bf0f51a36c82169b432a5184143d09e1 +Subproject commit d892a842277dd78199b608c40da297a73de24c91 diff --git a/ui/app/AppLayouts/Onboarding/controls/AccountViewDelegate.qml b/ui/app/AppLayouts/Onboarding/controls/AccountViewDelegate.qml index e4ac1d7a48..eb49760495 100644 --- a/ui/app/AppLayouts/Onboarding/controls/AccountViewDelegate.qml +++ b/ui/app/AppLayouts/Onboarding/controls/AccountViewDelegate.qml @@ -69,7 +69,7 @@ Rectangle { id: addressText width: 108 text: address - font.family: Style.current.fontHexRegular.name + font.family: Style.current.monoFont.name elide: Text.ElideMiddle anchors.bottom: accountImage.bottom anchors.bottomMargin: 0 diff --git a/ui/app/AppLayouts/Profile/views/EnsTermsAndConditionsView.qml b/ui/app/AppLayouts/Profile/views/EnsTermsAndConditionsView.qml index fb4c98b86d..eb9fe44799 100644 --- a/ui/app/AppLayouts/Profile/views/EnsTermsAndConditionsView.qml +++ b/ui/app/AppLayouts/Profile/views/EnsTermsAndConditionsView.qml @@ -165,7 +165,7 @@ Item { wrapMode: Text.WordWrap anchors.left: parent.left anchors.right: parent.right - font.family: Style.current.fontHexRegular.name + font.family: Style.current.monoFont.name color: Theme.palette.directColor1 } @@ -189,7 +189,7 @@ Item { wrapMode: Text.WordWrap anchors.left: parent.left anchors.right: parent.right - font.family: Style.current.fontHexRegular.name + font.family: Style.current.monoFont.name color: Theme.palette.directColor1 } diff --git a/ui/app/AppLayouts/Wallet/controls/HeaderButton.qml b/ui/app/AppLayouts/Wallet/controls/HeaderButton.qml index 389c59d693..876686b450 100644 --- a/ui/app/AppLayouts/Wallet/controls/HeaderButton.qml +++ b/ui/app/AppLayouts/Wallet/controls/HeaderButton.qml @@ -47,7 +47,7 @@ Rectangle { anchors.leftMargin: headerButton.margin anchors.verticalCenter: parent.verticalCenter font.pixelSize: 13 - font.family: Style.current.fontMedium.name + font.family: Style.current.baseFont.name font.weight: Font.Medium color: Style.current.blue } diff --git a/ui/app/AppLayouts/Wallet/panels/SeedPhraseBackupWarning.qml b/ui/app/AppLayouts/Wallet/panels/SeedPhraseBackupWarning.qml index 7e2a4feed3..c073c37664 100644 --- a/ui/app/AppLayouts/Wallet/panels/SeedPhraseBackupWarning.qml +++ b/ui/app/AppLayouts/Wallet/panels/SeedPhraseBackupWarning.qml @@ -35,7 +35,7 @@ Rectangle { text: qsTr("Back up") font.pixelSize: 13 font.weight: Font.Medium - font.family: Style.current.fontRegular.name + font.family: Style.current.baseFont.name horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter anchors.top: parent.top diff --git a/ui/imports/Themes/Theme.qml b/ui/imports/Themes/Theme.qml index 7ed3f52f24..f73cce6ec1 100644 --- a/ui/imports/Themes/Theme.qml +++ b/ui/imports/Themes/Theme.qml @@ -2,17 +2,19 @@ import QtQuick 2.13 import utils 1.0 QtObject { - property QtObject fontMedium: FontLoader { id: _fontMedium; source: "../../fonts/Inter/Inter-Medium.otf"; } - property QtObject fontBold: FontLoader { id: _fontBold; source: "../../fonts/Inter/Inter-Bold.otf"; } - property QtObject fontLight: FontLoader { id: _fontLight; source: "../../fonts/Inter/Inter-Light.otf"; } - property QtObject fontRegular: FontLoader { id: _fontRegular; source: "../../fonts/Inter/Inter-Regular.otf"; } + readonly property FontLoader baseFont: FontLoader { source: "../../fonts/Inter/Inter-Regular.otf" } + readonly property FontLoader monoFont: FontLoader { source: "../../fonts/InterStatus/InterStatus-Regular.otf" } + readonly property FontLoader codeFont: FontLoader { source: "../../fonts/RobotoMono/RobotoMono-Regular.ttf" } - property QtObject fontHexMedium: FontLoader { id: _fontHexMedium; source: "../../fonts/InterStatus/InterStatus-Medium.otf"; } - property QtObject fontHexBold: FontLoader { id: _fontHexBold; source: "../../fonts/InterStatus/InterStatus-Bold.otf"; } - property QtObject fontHexLight: FontLoader { id: _fontHexLight; source: "../../fonts/InterStatus/InterStatus-Light.otf"; } - property QtObject fontHexRegular: FontLoader { id: _fontHexRegular; source: "../../fonts/InterStatus/InterStatus-Regular.otf"; } + readonly property QtObject _d: QtObject { + readonly property FontLoader baseFontMedium: FontLoader { source: "../../fonts/Inter/Inter-Medium.otf" } + readonly property FontLoader baseFontBold: FontLoader { source: "../../fonts/Inter/Inter-Bold.otf" } + readonly property FontLoader baseFontLight: FontLoader { source: "../../fonts/Inter/Inter-Light.otf" } - property QtObject fontCodeRegular: FontLoader { id: _fontCodeRegular; source: "../../fonts/RobotoMono/RobotoMono-Regular.ttf"; } + readonly property FontLoader monoFontMedium: FontLoader { source: "../../fonts/InterStatus/InterStatus-Medium.otf" } + readonly property FontLoader monoFontBold: FontLoader { source: "../../fonts/InterStatus/InterStatus-Bold.otf" } + readonly property FontLoader monoFontLight: FontLoader { source: "../../fonts/InterStatus/InterStatus-Light.otf" } + } property string name diff --git a/ui/imports/shared/controls/RecipientSelector.qml b/ui/imports/shared/controls/RecipientSelector.qml index 2ec52c0a23..dd83090343 100644 --- a/ui/imports/shared/controls/RecipientSelector.qml +++ b/ui/imports/shared/controls/RecipientSelector.qml @@ -120,7 +120,7 @@ Item { visible: label !== "" text: qsTr("Recipient") font.pixelSize: 13 - font.family: Style.current.fontRegular.name + font.family: Style.current.baseFont.name font.weight: Font.Medium color: Style.current.textColor height: 18 @@ -131,7 +131,7 @@ Item { visible: text !== "" text: "" font.pixelSize: 13 - font.family: Style.current.fontRegular.name + font.family: Style.current.baseFont.name font.weight: Font.Medium color: Style.current.danger height: 18 diff --git a/ui/imports/shared/controls/StyledTextArea.qml b/ui/imports/shared/controls/StyledTextArea.qml index c83ee23d28..99f0c61e64 100644 --- a/ui/imports/shared/controls/StyledTextArea.qml +++ b/ui/imports/shared/controls/StyledTextArea.qml @@ -60,7 +60,7 @@ Item { anchors.bottomMargin: Style.current.smallPadding anchors.topMargin: Style.current.smallPadding anchors.fill: parent - font.family: Style.current.fontRegular.name + font.family: Style.current.baseFont.name color: Style.current.textColor placeholderTextColor: Style.current.secondaryText selectionColor: Style.current.primarySelectionColor diff --git a/ui/imports/shared/controls/StyledTextEdit.qml b/ui/imports/shared/controls/StyledTextEdit.qml index 9ea141240c..138d0b2a3f 100644 --- a/ui/imports/shared/controls/StyledTextEdit.qml +++ b/ui/imports/shared/controls/StyledTextEdit.qml @@ -3,7 +3,7 @@ import QtQuick 2.13 import utils 1.0 TextEdit { - font.family: Style.current.fontRegular.name + font.family: Style.current.baseFont.name color: Style.current.textColor selectedTextColor: Style.current.textColor selectionColor: Style.current.primarySelectionColor diff --git a/ui/imports/shared/controls/StyledTextField.qml b/ui/imports/shared/controls/StyledTextField.qml index 44ea0de7f7..c97fd52cd4 100644 --- a/ui/imports/shared/controls/StyledTextField.qml +++ b/ui/imports/shared/controls/StyledTextField.qml @@ -4,7 +4,7 @@ import QtQuick.Controls 2.13 import utils 1.0 TextField { - font.family: Style.current.fontRegular.name + font.family: Style.current.baseFont.name color: readOnly ? Style.current.secondaryText : Style.current.textColor selectByMouse: !readOnly selectedTextColor: Style.current.textColor diff --git a/ui/imports/shared/panels/Address.qml b/ui/imports/shared/panels/Address.qml index cc24af4a25..05f7252634 100644 --- a/ui/imports/shared/panels/Address.qml +++ b/ui/imports/shared/panels/Address.qml @@ -10,7 +10,7 @@ StyledText { id: addressComponent text: "0x9ce0056c5fc6bb9459a4dcfa35eaad8c1fee5ce9" font.pixelSize: 13 - font.family: Style.current.fontHexRegular.name + font.family: Style.current.monoFont.name elide: Text.ElideMiddle color: Style.current.secondaryText diff --git a/ui/imports/shared/panels/ModuleWarning.qml b/ui/imports/shared/panels/ModuleWarning.qml index 75b9d7c6ee..fa73d1b5b5 100644 --- a/ui/imports/shared/panels/ModuleWarning.qml +++ b/ui/imports/shared/panels/ModuleWarning.qml @@ -145,7 +145,7 @@ Item { text: button.text font.pixelSize: 12 font.weight: Font.Medium - font.family: Style.current.fontRegular.name + font.family: Style.current.baseFont.name horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter color: Theme.palette.indirectColor1 diff --git a/ui/imports/shared/panels/StyledText.qml b/ui/imports/shared/panels/StyledText.qml index dc1f8280f6..be181b365e 100644 --- a/ui/imports/shared/panels/StyledText.qml +++ b/ui/imports/shared/panels/StyledText.qml @@ -3,6 +3,6 @@ import QtQuick 2.13 import utils 1.0 Text { - font.family: Style.current.fontRegular.name + font.family: Style.current.baseFont.name color: Style.current.textColor } diff --git a/ui/imports/shared/panels/TextWithLabel.qml b/ui/imports/shared/panels/TextWithLabel.qml index 7a34184807..b298085c3e 100644 --- a/ui/imports/shared/panels/TextWithLabel.qml +++ b/ui/imports/shared/panels/TextWithLabel.qml @@ -11,7 +11,7 @@ import "./" Item { property string text: "My Text" property string label: "My Label" - property string fontFamily: Style.current.fontRegular.name + property string fontFamily: Style.current.baseFont.name property string textToCopy: "" property alias value: textItem property bool wrap: false diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 8a7d25a3f0..111075930e 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -1072,7 +1072,7 @@ Rectangle { textFormat: Text.RichText font.pixelSize: 15 - font.family: Style.current.fontRegular.name + font.family: Style.current.baseFont.name wrapMode: TextArea.Wrap placeholderText: control.chatInputPlaceholder placeholderTextColor: Style.current.secondaryText diff --git a/ui/imports/shared/status/StatusExpandableAddress.qml b/ui/imports/shared/status/StatusExpandableAddress.qml index 1e9d15347d..4c7ffabf6a 100644 --- a/ui/imports/shared/status/StatusExpandableAddress.qml +++ b/ui/imports/shared/status/StatusExpandableAddress.qml @@ -27,7 +27,7 @@ Item { id: addressText text: root.address font.pixelSize: 13 - font.family: Style.current.fontHexRegular.name + font.family: Style.current.monoFont.name color: Style.current.secondaryText elide: Text.ElideMiddle horizontalAlignment: Text.AlignHCenter diff --git a/ui/imports/shared/status/StatusStickerButton.qml b/ui/imports/shared/status/StatusStickerButton.qml index 03052d981a..1233dfd7b7 100644 --- a/ui/imports/shared/status/StatusStickerButton.qml +++ b/ui/imports/shared/status/StatusStickerButton.qml @@ -127,7 +127,7 @@ Item { TextMetrics { id: textMetrics font.weight: Font.Medium - font.family: Style.current.fontBold.name + font.family: Style.current.baseFont.name font.pixelSize: 15 text: root.text } @@ -215,7 +215,7 @@ Item { anchors.verticalCenter: parent.verticalCenter text: root.text font.weight: Font.Medium - font.family: Style.current.fontBold.name + font.family: Style.current.baseFont.name font.pixelSize: 15 states: [ State { diff --git a/ui/imports/shared/status/StatusStickerPackDetails.qml b/ui/imports/shared/status/StatusStickerPackDetails.qml index 573244949a..d8598c9d7d 100644 --- a/ui/imports/shared/status/StatusStickerPackDetails.qml +++ b/ui/imports/shared/status/StatusStickerPackDetails.qml @@ -31,14 +31,14 @@ Item { StyledText { id: txtPackName text: packName - font.family: Style.current.fontBold.name + font.family: Style.current.baseFont.name font.weight: Font.Bold font.pixelSize: packNameFontSize } StyledText { color: Style.current.secondaryText text: packAuthor - font.family: Style.current.fontRegular.name + font.family: Style.current.baseFont.name font.pixelSize: 15 } }