Skip to content

Commit 075e216

Browse files
committed
Merge #232: Add ContinueButton interaction color animation states
39b4c15 qml: add ContinueButton interaction color animation states (Jarol Rodriguez) Pull request description: Introduces the missing ContinueButton interaction color animation states as detailed in #229 #### Dark Mode | Default | Hovered | Pressed | | ------- | ------- | ------- | | <img width="321" alt="Screen Shot 2023-01-28 at 6 21 06 PM" src="https://user-images.githubusercontent.com/23396902/215295733-5b592123-a94e-45d8-bb33-49abed4c4d97.png"> | <img width="321" alt="Screen Shot 2023-01-28 at 6 21 25 PM" src="https://user-images.githubusercontent.com/23396902/215295740-e4210277-b678-4ce6-b983-2ce35940c39f.png"> | <img width="321" alt="Screen Shot 2023-01-28 at 6 21 40 PM" src="https://user-images.githubusercontent.com/23396902/215295741-e9eeec10-7fce-4289-8962-86860246954d.png"> | #### Light Mode | Default | Hovered | Pressed | | ------- | ------- | ------- | | <img width="321" alt="Screen Shot 2023-01-28 at 6 22 32 PM" src="https://user-images.githubusercontent.com/23396902/215295762-e96bf64c-5da8-4636-98e6-451892cf959a.png"> | <img width="321" alt="Screen Shot 2023-01-28 at 6 22 53 PM" src="https://user-images.githubusercontent.com/23396902/215295768-99db7c5e-b6f9-43dd-94d6-bec7d778abb8.png"> | <img width="321" alt="Screen Shot 2023-01-28 at 6 23 03 PM" src="https://user-images.githubusercontent.com/23396902/215295778-2e1a3961-333f-42bf-9293-c0f74c67b5ce.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/232) [![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/232) [![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/232) [![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/232) Closes #229 ACKs for top commit: johnny9: ACK 39b4c15 Tree-SHA512: 5c61c0e776f39323015711213dff20b6988be02c69a6ca46cdd8065ed85d1fca5b0f9e3274e511dbc907e487b48ef08966b3a91253fbf2073e26eb80c5b5bd3a
2 parents a56361d + 39b4c15 commit 075e216

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/qml/controls/ContinueButton.qml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import QtQuick 2.15
66
import QtQuick.Controls 2.15
77

88
Button {
9+
id: root
910
font.family: "Inter"
1011
font.styleName: "Semi Bold"
1112
font.pixelSize: 18
@@ -17,9 +18,47 @@ Button {
1718
verticalAlignment: Text.AlignVCenter
1819
}
1920
background: Rectangle {
21+
id: bg
2022
implicitHeight: 46
2123
implicitWidth: 300
2224
color: Theme.color.orange
2325
radius: 5
26+
state:"DEFAULT"
27+
28+
states: [
29+
State {
30+
name: "DEFAULT"
31+
PropertyChanges { target: bg; color: Theme.color.orange }
32+
},
33+
State {
34+
name: "HOVER"
35+
PropertyChanges { target: bg; color: Theme.color.orangeLight1 }
36+
},
37+
State {
38+
name: "PRESSED"
39+
PropertyChanges { target: bg; color: Theme.color.orangeLight2 }
40+
}
41+
]
42+
43+
Behavior on color {
44+
ColorAnimation { duration: 150 }
45+
}
46+
}
47+
MouseArea {
48+
anchors.fill: parent
49+
hoverEnabled: true
50+
onEntered: {
51+
root.background.state = "HOVER"
52+
}
53+
onExited: {
54+
root.background.state = "DEFAULT"
55+
}
56+
onPressed: {
57+
root.background.state = "PRESSED"
58+
}
59+
onReleased: {
60+
root.background.state = "DEFAULT"
61+
root.clicked()
62+
}
2463
}
2564
}

src/qml/controls/Theme.qml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Control {
1111
required property color white
1212
required property color background
1313
required property color orange
14+
required property color orangeLight1
15+
required property color orangeLight2
1416
required property color red
1517
required property color green
1618
required property color blue
@@ -38,6 +40,8 @@ Control {
3840
white: "#FFFFFF"
3941
background: "black"
4042
orange: "#F89B2A"
43+
orangeLight1: "#FFAD4A"
44+
orangeLight2: "#FFBF72"
4145
red: "#EC6363"
4246
green: "#36B46B"
4347
blue: "#3CA3DE"
@@ -59,6 +63,8 @@ Control {
5963
white: "#FFFFFF"
6064
background: "white"
6165
orange: "#F7931A"
66+
orangeLight1: "#FFAD4A"
67+
orangeLight2: "#FFBF72"
6268
red: "#EB5757"
6369
green: "#27AE60"
6470
blue: "#2D9CDB"

0 commit comments

Comments
 (0)