Skip to content

Commit f96e63f

Browse files
committed
Merge #260: Fix NavButton padding
9aec75d qml: remove rightMargin value for element placed on the right of navbar (jarolrod) 0cee6c3 qml: fix NavButton padding (jarolrod) Pull request description: Applies proper padding values to NavButton so that it can fit the specifications in the design file for [icon buttons](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=4998%3A117938&t=fZfJaPNYvvK1gzU4-4), [icon and text buttons](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=4998%3A117920&t=fZfJaPNYvvK1gzU4-4), and [text buttons](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=4998%3A117908&t=fZfJaPNYvvK1gzU4-4). | master | | ------ | | ![master](https://user-images.githubusercontent.com/23396902/218366429-d99d9bc9-c040-4d75-948b-65d6db290b12.png) | | pr | | ------ | | ![pr](https://user-images.githubusercontent.com/23396902/218366479-50b706d8-6c26-410e-9e78-75066e4534bd.png) | [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/260) [![Intel macOS](https://img.shields.io/badge/OS-Intel%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/260) [![Apple Silicon macOS](https://img.shields.io/badge/OS-Apple%20Silicon%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/insecure_mac_arm64_gui.zip?branch=pull/260) [![ARM64 Android](https://img.shields.io/badge/OS-Android-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/insecure_android_apk.zip?branch=pull/260) ACKs for top commit: GBKS: ACK 9aec75d johnny9: ACK 9aec75d Tree-SHA512: 81c7c2ae7687ce43138ee68da36a8b20d6af2a2304d1571f369aa0e4f578e53a0fd1c339bcc139f1ce84dcbbab5cea6294e8a3b028bd2e75a6511a11ad99c391
2 parents 29c4a9f + 9aec75d commit f96e63f

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

src/qml/controls/NavButton.qml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ AbstractButton {
1515
property Rectangle iconBackground: null
1616
property color iconColor: Theme.color.neutral9
1717

18-
padding: 0
18+
topPadding: text_background.active ? 7 : 14
19+
bottomPadding: text_background.active ? 7 : 14
20+
rightPadding: text_background.active ? 22 : 14
21+
leftPadding: text_background.active ? 2 : 14
1922
background: Rectangle {
2023
id: bg
2124
height: root.height
@@ -43,7 +46,6 @@ AbstractButton {
4346
}
4447
}
4548
contentItem: RowLayout {
46-
anchors.fill: parent
4749
spacing: 0
4850
Loader {
4951
id: button_background
@@ -63,22 +65,25 @@ AbstractButton {
6365
}
6466
}
6567
Loader {
66-
active: root.text.length > 0
67-
visible: active
68-
sourceComponent: AbstractButton {
69-
id: container
70-
padding: 0
71-
font.family: "Inter"
72-
font.styleName: "Semi Bold"
73-
font.pixelSize: root.textSize
74-
background: null
75-
contentItem: Text {
76-
anchors.verticalCenter: parent.verticalCenter
77-
font: container.font
78-
color: Theme.color.neutral9
79-
text: root.text
80-
}
81-
}
68+
id: text_background
69+
active: root.text.length > 0
70+
visible: active
71+
sourceComponent: AbstractButton {
72+
id: container
73+
topPadding: button_background.active ? 0 : 4
74+
bottomPadding: button_background.active ? 0 : 4
75+
rightPadding: 0
76+
leftPadding: button_background.active ? 0 : 20
77+
font.family: "Inter"
78+
font.styleName: "Semi Bold"
79+
font.pixelSize: root.textSize
80+
contentItem: Text {
81+
anchors.verticalCenter: parent.verticalCenter
82+
font: container.font
83+
color: Theme.color.neutral9
84+
text: root.text
85+
}
86+
}
8287
}
8388
}
8489
MouseArea {

src/qml/controls/NavigationBar.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ RowLayout {
3939
Layout.preferredWidth: parent.width / 3
4040
Loader {
4141
id: right_detail
42-
Layout.rightMargin: 10
4342
Layout.alignment: Qt.AlignRight
4443
active: true
4544
visible: active

0 commit comments

Comments
 (0)