Skip to content

Commit 3874d63

Browse files
committed
qml: make external links follow the specs in the design file
1 parent 2a9847b commit 3874d63

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

src/qml/components/AboutOptions.qml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ ColumnLayout {
1515
actionItem: ExternalLink {
1616
description: "bitcoincore.org"
1717
link: "https://bitcoincore.org"
18-
iconSource: "image://images/caret-right"
1918
}
2019
}
2120
Setting {
@@ -24,7 +23,6 @@ ColumnLayout {
2423
actionItem: ExternalLink {
2524
description: "github.com/bitcoin/bitcoin"
2625
link: "https://github.com/bitcoin/bitcoin"
27-
iconSource: "image://images/caret-right"
2826
}
2927
}
3028
Setting {
@@ -33,7 +31,6 @@ ColumnLayout {
3331
actionItem: ExternalLink {
3432
description: "MIT"
3533
link: "https://opensource.org/licenses/MIT"
36-
iconSource: "image://images/caret-right"
3734
}
3835
}
3936
Setting {
@@ -43,6 +40,8 @@ ColumnLayout {
4340
description: "v22.99.0-1e7564eca8a6"
4441
link: "https://bitcoin.org/en/download"
4542
iconSource: "image://images/caret-right"
43+
iconWidth: 18
44+
iconHeight: 18
4645
}
4746
}
4847
Setting {

src/qml/controls/ExternalLink.qml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Control {
1111
required property string link
1212
property string description: ""
1313
property int descriptionSize: 18
14-
property url iconSource: ""
15-
property int iconWidth: 18
16-
property int iconHeight: 18
14+
property url iconSource: "image://images/export"
15+
property int iconWidth: 22
16+
property int iconHeight: 22
1717

1818
contentItem: RowLayout {
1919
spacing: 0
@@ -27,23 +27,18 @@ Control {
2727
font.styleName: "Regular"
2828
font.pixelSize: root.descriptionSize
2929
color: Theme.color.neutral7
30-
textFormat: Text.RichText
31-
text: "<style>a:link { color: " + Theme.color.neutral7 + "; text-decoration: none;}</style>" + "<a href=\"" + link + "\">" + root.description + "</a>"
30+
text: root.description
3231
onLinkActivated: Qt.openUrlExternally(link)
3332
}
3433
}
35-
Loader {
36-
Layout.fillWidth: true
37-
active: root.iconSource.toString().length > 0
38-
visible: active
39-
sourceComponent: Button {
40-
icon.source: root.iconSource
41-
icon.color: Theme.color.neutral9
42-
icon.height: root.iconHeight
43-
icon.width: root.iconWidth
44-
background: null
45-
onClicked: Qt.openUrlExternally(link)
46-
}
34+
Button {
35+
leftPadding: 0
36+
icon.source: root.iconSource
37+
icon.color: Theme.color.neutral9
38+
icon.height: root.iconHeight
39+
icon.width: root.iconWidth
40+
background: null
41+
onClicked: Qt.openUrlExternally(link)
4742
}
4843
}
4944
}

0 commit comments

Comments
 (0)