Skip to content

Commit a665c23

Browse files
committed
Merge #246: Introduce TextButton color interaction states & fix margins
3be7fda qml: Introduce TextButton color interaction states (Jarol Rodriguez) 8658fe8 qml: allow to specify button and detailItem margin (Jarol Rodriguez) Pull request description: Introduces color interaction states for the TextButton control, as specified in the design file. #### Light | [Default](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=6335%3A24025&t=1HgWYBIOiBJFlWQ1-4) | [Hover](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=6335%3A24023&t=1HgWYBIOiBJFlWQ1-4) | [Pressed](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=6335%3A24024&t=1HgWYBIOiBJFlWQ1-4) | | ------- | ----- | ------- | | <img width="752" alt="Screen Shot 2023-02-02 at 7 51 37 PM" src="https://user-images.githubusercontent.com/23396902/216486226-5798cb07-2666-4f11-8569-7f2e2795ce85.png"> | <img width="752" alt="Screen Shot 2023-02-02 at 7 52 36 PM" src="https://user-images.githubusercontent.com/23396902/216486246-e93b9141-acbe-4c8f-a6f7-6f6666cb5cf7.png"> | <img width="752" alt="Screen Shot 2023-02-02 at 7 52 48 PM" src="https://user-images.githubusercontent.com/23396902/216486263-4a719fd2-8f49-4c8e-96ab-f909efe267c1.png"> | #### Dark | [Default](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=6335%3A24025&t=1HgWYBIOiBJFlWQ1-4) | [Hover](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=6335%3A24023&t=1HgWYBIOiBJFlWQ1-4) | [Pressed](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=6335%3A24024&t=1HgWYBIOiBJFlWQ1-4) | | ------- | ----- | ------- | | <img width="752" alt="Screen Shot 2023-02-02 at 7 50 46 PM" src="https://user-images.githubusercontent.com/23396902/216486148-1e021989-d7fd-4ef6-9730-5dcd12781426.png"> | <img width="752" alt="Screen Shot 2023-02-02 at 7 50 58 PM" src="https://user-images.githubusercontent.com/23396902/216486194-3e36e177-faa5-4d2f-92c3-9c1da6001da0.png"> | <img width="752" alt="Screen Shot 2023-02-02 at 7 51 12 PM" src="https://user-images.githubusercontent.com/23396902/216486204-6bfd6608-0096-4658-b620-df0c39b4394a.png"> | This makes sure the padding is correct for the TextButton and that the margin is correct for both the TextButton and ContinueButton are as specified in the design file | TextButton Padding | TextButton Margin | ContinueButton Margin | | ------------------ | ----------------- | --------------------- | | <img width="346" alt="Screen Shot 2023-02-02 at 8 10 33 PM" src="https://user-images.githubusercontent.com/23396902/216487130-d18307a3-2acf-4cdb-bf70-4a92ea52952c.png"> | <img width="346" alt="Screen Shot 2023-02-02 at 8 09 06 PM" src="https://user-images.githubusercontent.com/23396902/216487147-86fa4051-c009-497f-ace0-a61a12eb17ca.png"> | <img width="346" alt="Screen Shot 2023-02-02 at 8 09 37 PM" src="https://user-images.githubusercontent.com/23396902/216487166-4d602c5f-4a0c-4968-9163-05430c36b21a.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/<PR>) [![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/<PR>) [![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/<PR>) [![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/<PR>) ACKs for top commit: johnny9: ACK 3be7fda Tree-SHA512: 55c2f8a0dfdd26d67a173f9bfe80a0389e7c5261a642fb5f05ddddc4bf86541763d3cf754a7456b6524d0c935c00da62bed7015b205d5cd6226f0ded17500ff5
2 parents 7cd989d + 3be7fda commit a665c23

File tree

4 files changed

+74
-10
lines changed

4 files changed

+74
-10
lines changed

src/qml/controls/InformationPage.qml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ Page {
1616
property alias navMiddleDetail: navbar.middleDetail
1717
property alias navRightDetail: navbar.rightDetail
1818
property string buttonText: ""
19+
property int buttonMargin: 40
1920
property bool bannerActive: true
2021
property bool detailActive: false
22+
property int detailTopMargin: 30
2123
property bool lastPage: false
2224
property bool bold: false
2325
property bool center: true
@@ -83,7 +85,7 @@ Page {
8385
visible: active
8486
Layout.fillWidth: true
8587
Layout.alignment: Qt.AlignCenter
86-
Layout.topMargin: 30
88+
Layout.topMargin: root.detailTopMargin
8789
Layout.leftMargin: 20
8890
Layout.rightMargin: 20
8991
Layout.maximumWidth: detailMaximumWidth
@@ -95,7 +97,7 @@ Page {
9597
visible: root.buttonText.length > 0
9698
enabled: visible
9799
width: Math.min(300, parent.width - 2 * anchors.leftMargin)
98-
anchors.topMargin: 40
100+
anchors.topMargin: root.buttonMargin
99101
anchors.bottomMargin: 60
100102
anchors.leftMargin: 20
101103
anchors.rightMargin: 20

src/qml/controls/TextButton.qml

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,74 @@ import QtQuick.Controls 2.15
88
Button {
99
id: root
1010
property int textSize: 18
11-
property string textColor: Theme.color.orange
11+
property color textColor
12+
property color bgColor
1213
property bool bold: true
1314
property bool rightalign: false
1415
font.family: "Inter"
1516
font.styleName: bold ? "Semi Bold" : "Regular"
1617
font.pixelSize: root.textSize
18+
padding: 15
19+
state: "DEFAULT"
1720
contentItem: Text {
1821
text: root.text
1922
font: root.font
2023
color: root.textColor
2124
horizontalAlignment: rightalign ? Text.AlignRight : Text.AlignHCenter
2225
verticalAlignment: Text.AlignVCenter
26+
Behavior on color {
27+
ColorAnimation { duration: 150 }
28+
}
29+
}
30+
background: Rectangle {
31+
id: bg
32+
color: root.bgColor
33+
radius: 5
34+
Behavior on color {
35+
ColorAnimation { duration: 150 }
36+
}
37+
}
38+
states: [
39+
State {
40+
name: "DEFAULT"
41+
PropertyChanges {
42+
target: root
43+
textColor: Theme.color.orange
44+
bgColor: Theme.color.background
45+
}
46+
},
47+
State {
48+
name: "HOVER"
49+
PropertyChanges {
50+
target: root
51+
textColor: Theme.color.orangeLight1
52+
bgColor: Theme.color.neutral2
53+
}
54+
},
55+
State {
56+
name: "PRESSED"
57+
PropertyChanges {
58+
target: root
59+
textColor: Theme.color.orangeLight2
60+
bgColor: Theme.color.neutral3
61+
}
62+
}
63+
]
64+
MouseArea {
65+
anchors.fill: parent
66+
hoverEnabled: true
67+
onEntered: {
68+
root.state = "HOVER"
69+
}
70+
onExited: {
71+
root.state = "DEFAULT"
72+
}
73+
onPressed: {
74+
root.state = "PRESSED"
75+
}
76+
onReleased: {
77+
root.state = "DEFAULT"
78+
root.clicked()
79+
}
2380
}
24-
background: null
2581
}

src/qml/pages/onboarding/OnboardingConnection.qml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,19 @@ Page {
3434
headerText: qsTr("Starting initial download")
3535
headerMargin: 30
3636
description: qsTr("The application will connect to the Bitcoin network and start downloading and verifying transactions.\n\nThis may take several hours, or even days, based on your connection.")
37-
descriptionMargin: 20
37+
descriptionMargin: 10
3838
detailActive: true
39-
detailItem: TextButton {
40-
text: qsTr("Connection settings")
41-
onClicked: connections.incrementCurrentIndex()
39+
detailTopMargin: 10
40+
detailItem: RowLayout {
41+
TextButton {
42+
Layout.alignment: Qt.AlignCenter
43+
text: qsTr("Connection settings")
44+
onClicked: connections.incrementCurrentIndex()
45+
}
4246
}
4347
lastPage: true
4448
buttonText: qsTr("Next")
49+
buttonMargin: 20
4550
}
4651
SettingsConnection {
4752
navRightDetail: NavButton {

src/qml/pages/onboarding/OnboardingStorageAmount.qml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ Page {
3737
Layout.alignment: Qt.AlignCenter
3838
}
3939
TextButton {
40-
Layout.topMargin: 30
41-
Layout.fillWidth: true
40+
Layout.topMargin: 10
41+
Layout.alignment: Qt.AlignCenter
4242
text: qsTr("Detailed settings")
4343
onClicked: storages.incrementCurrentIndex()
4444
}
4545
}
4646
buttonText: qsTr("Next")
47+
buttonMargin: 20
4748
}
4849
SettingsStorage {
4950
navRightDetail: NavButton {

0 commit comments

Comments
 (0)