Skip to content

Commit 0fc3fdc

Browse files
committed
2 parents 655365b + 32a11f3 commit 0fc3fdc

File tree

9 files changed

+36
-34
lines changed

9 files changed

+36
-34
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ QML_RES_QML = \
345345
qml/components/StorageOptions.qml \
346346
qml/components/StorageSettings.qml \
347347
qml/controls/ContinueButton.qml \
348+
qml/controls/CoreText.qml \
348349
qml/controls/ExternalLink.qml \
349350
qml/controls/Header.qml \
350351
qml/controls/InformationPage.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<file>components/StorageOptions.qml</file>
1616
<file>components/StorageSettings.qml</file>
1717
<file>controls/ContinueButton.qml</file>
18+
<file>controls/CoreText.qml</file>
1819
<file>controls/ExternalLink.qml</file>
1920
<file>controls/Header.qml</file>
2021
<file>controls/InformationPage.qml</file>

src/qml/components/NetworkIndicator.qml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,14 @@ Button {
1313
id: root
1414
property color bgColor
1515
property int textSize: 15
16-
font.family: "Inter"
17-
font.styleName: "Regular"
18-
font.pixelSize: root.textSize
1916
topPadding: 2
2017
bottomPadding: 2
2118
leftPadding: 7
2219
rightPadding: 7
2320
state: chainModel.currentNetworkName
24-
contentItem: Text {
21+
contentItem: CoreText {
2522
text: root.text
26-
font: root.font
23+
font.pixelSize: root.textSize
2724
color: Theme.color.white
2825
horizontalAlignment: Text.AlignHCenter
2926
verticalAlignment: Text.AlignVCenter

src/qml/controls/ContinueButton.qml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,11 @@ import QtQuick.Controls 2.15
77

88
Button {
99
id: root
10-
font.family: "Inter"
11-
font.styleName: "Semi Bold"
12-
font.pixelSize: 18
1310
hoverEnabled: true
14-
contentItem: Text {
11+
contentItem: CoreText {
1512
text: parent.text
16-
font: parent.font
17-
color: Theme.color.white
18-
horizontalAlignment: Text.AlignHCenter
19-
verticalAlignment: Text.AlignVCenter
13+
bold: true
14+
font.pixelSize: 18
2015
}
2116
background: Rectangle {
2217
id: bg

src/qml/controls/CoreText.qml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) 2023 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
import QtQuick 2.15
6+
import QtQuick.Controls 2.15
7+
8+
Text {
9+
property bool bold: false
10+
property bool wrap: true
11+
color: Theme.color.white
12+
font.family: "Inter"
13+
font.styleName: bold ? "Semi Bold" : "Regular"
14+
font.pixelSize: 13
15+
horizontalAlignment: Text.AlignHCenter
16+
verticalAlignment: Text.AlignVCenter
17+
wrapMode: wrap ? Text.WordWrap : Text.NoWrap
18+
}

src/qml/controls/ExternalLink.qml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ AbstractButton {
4545
Layout.fillWidth: true
4646
active: root.description.length > 0
4747
visible: active
48-
sourceComponent: Text {
49-
font.family: "Inter"
50-
font.styleName: "Regular"
48+
sourceComponent: CoreText {
5149
font.pixelSize: root.descriptionSize
5250
color: root.textColor
5351
textFormat: Text.RichText
5452
text: root.description
53+
wrap: false
5554

5655
Behavior on color {
5756
ColorAnimation { duration: 150 }

src/qml/controls/NavButton.qml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,10 @@ AbstractButton {
7474
bottomPadding: button_background.active ? 0 : 4
7575
rightPadding: 0
7676
leftPadding: button_background.active ? 0 : 20
77-
font.family: "Inter"
78-
font.styleName: "Semi Bold"
79-
font.pixelSize: root.textSize
80-
contentItem: Text {
77+
contentItem: CoreText {
8178
anchors.verticalCenter: parent.verticalCenter
82-
font: container.font
79+
bold: true
80+
font.pixelSize: root.textSize
8381
color: Theme.color.neutral9
8482
text: root.text
8583
}

src/qml/controls/OutlineButton.qml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@ import QtQuick.Controls 2.15
77

88
Button {
99
id: root
10-
font.family: "Inter"
11-
font.styleName: "Semi Bold"
12-
font.pixelSize: 18
1310
hoverEnabled: true
14-
contentItem: Text {
11+
contentItem: CoreText {
1512
text: parent.text
16-
font: parent.font
13+
bold: true
14+
font.pixelSize: 18
1715
color: Theme.color.neutral9
18-
horizontalAlignment: Text.AlignHCenter
19-
verticalAlignment: Text.AlignVCenter
2016
}
2117
background: Rectangle {
2218
id: bg

src/qml/controls/TextButton.qml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ Button {
1212
property color bgColor: Theme.color.background
1313
property bool bold: true
1414
property bool rightalign: false
15-
font.family: "Inter"
16-
font.styleName: bold ? "Semi Bold" : "Regular"
17-
font.pixelSize: root.textSize
1815
padding: 15
1916
hoverEnabled: true
20-
contentItem: Text {
17+
contentItem: CoreText {
2118
text: root.text
22-
font: root.font
19+
bold: root.bold
20+
font.pixelSize: root.textSize
2321
color: root.textColor
2422
horizontalAlignment: rightalign ? Text.AlignRight : Text.AlignHCenter
25-
verticalAlignment: Text.AlignVCenter
2623
Behavior on color {
2724
ColorAnimation { duration: 150 }
2825
}

0 commit comments

Comments
 (0)