Skip to content

Commit 0dd350e

Browse files
committed
Merge #242: Introduce reusable CaretRightButton, bind color to Setting stateColor
624d985 qml: use CaretRightButton, bind to Setting state color (jarolrod) 2bd516d qml: add CaretRightButton component (jarolrod) Pull request description: This finishes setting up all current Settings to be able to respond to the Setting state. | Filled | Hover | Active | | ------ | ----- | ------ | | <img width="454" alt="Screen Shot 2023-02-01 at 2 12 02 AM" src="https://user-images.githubusercontent.com/23396902/215975827-b4a3b60c-f19b-483d-94a9-8c2191e48253.png"> | <img width="454" alt="Screen Shot 2023-02-01 at 2 12 11 AM" src="https://user-images.githubusercontent.com/23396902/215975854-d038ee42-4bda-4a87-8e04-bf76ebabb5b5.png"> | <img width="454" alt="Screen Shot 2023-02-01 at 2 12 19 AM" src="https://user-images.githubusercontent.com/23396902/215975871-d6a5b120-e53b-4b00-b5c4-7be1872a9e05.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/242) [![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/242) [![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/242) [![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/242) ACKs for top commit: johnny9: ACK 624d985 Tree-SHA512: 864312d8f8702ad30050cbb82ff7944e2bcbaedc29999fcf728e625214b59b26320ee600c674703246fb4e852f957b26bf7982716b14419501c14dcd38879e3f
2 parents 22838d2 + 624d985 commit 0dd350e

File tree

6 files changed

+37
-30
lines changed

6 files changed

+37
-30
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ QML_RES_QML = \
330330
qml/components/AboutOptions.qml \
331331
qml/components/BlockClock.qml \
332332
qml/components/BlockCounter.qml \
333+
qml/components/CaretRightButton.qml \
333334
qml/components/ConnectionOptions.qml \
334335
qml/components/ConnectionSettings.qml \
335336
qml/components/DeveloperOptions.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<file>components/AboutOptions.qml</file>
44
<file>components/BlockClock.qml</file>
55
<file>components/BlockCounter.qml</file>
6+
<file>components/CaretRightButton.qml</file>
67
<file>components/ConnectionOptions.qml</file>
78
<file>components/ConnectionSettings.qml</file>
89
<file>components/PeersIndicator.qml</file>

src/qml/components/AboutOptions.qml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,12 @@ ColumnLayout {
5858
onClicked: loadedItem.clicked()
5959
}
6060
Setting {
61+
id: gotoDeveloper
6162
Layout.fillWidth: true
6263
header: qsTr("Developer options")
6364
description: qsTr("Only use these if you have development experience")
64-
actionItem: Button {
65-
icon.source: "image://images/caret-right"
66-
icon.color: Theme.color.neutral9
67-
icon.height: 18
68-
icon.width: 18
69-
background: null
65+
actionItem: CaretRightButton{
66+
stateColor: gotoDeveloper.stateColor
7067
onClicked: {
7168
aboutSwipe.incrementCurrentIndex()
7269
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
Button {
9+
id: root
10+
required property color stateColor
11+
icon.source: "image://images/caret-right"
12+
icon.color: root.stateColor
13+
icon.height: 18
14+
icon.width: 18
15+
background: null
16+
17+
Behavior on icon.color {
18+
ColorAnimation { duration: 150 }
19+
}
20+
}

src/qml/components/ConnectionSettings.qml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,12 @@ ColumnLayout {
5959
}
6060
}
6161
Setting {
62+
id: gotoProxy
6263
last: true
6364
Layout.fillWidth: true
6465
header: qsTr("Proxy settings")
65-
actionItem: Button {
66-
icon.source: "image://images/caret-right"
67-
icon.color: Theme.color.neutral9
68-
icon.height: 18
69-
icon.width: 18
70-
background: null
66+
actionItem: CaretRightButton {
67+
stateColor: gotoProxy.stateColor
7168
}
7269
}
7370
}

src/qml/pages/node/NodeSettings.qml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,44 +47,35 @@ Item {
4747
onClicked: loadedItem.toggled()
4848
}
4949
Setting {
50+
id: gotoAbout
5051
Layout.fillWidth: true
5152
header: qsTr("About")
52-
actionItem: Button {
53-
icon.source: "image://images/caret-right"
54-
icon.color: Theme.color.neutral9
55-
icon.height: 18
56-
icon.width: 18
57-
background: null
53+
actionItem: CaretRightButton {
54+
stateColor: gotoAbout.stateColor
5855
onClicked: {
5956
nodeSettingsView.push(about_page)
6057
}
6158
}
6259
onClicked: loadedItem.clicked()
6360
}
6461
Setting {
62+
id: gotoStorage
6563
Layout.fillWidth: true
6664
header: qsTr("Storage")
67-
actionItem: Button {
68-
icon.source: "image://images/caret-right"
69-
icon.color: Theme.color.neutral9
70-
icon.height: 18
71-
icon.width: 18
72-
background: null
65+
actionItem: CaretRightButton {
66+
stateColor: gotoStorage.stateColor
7367
onClicked: {
7468
nodeSettingsView.push(storage_page)
7569
}
7670
}
7771
onClicked: loadedItem.clicked()
7872
}
7973
Setting {
74+
id: gotoConnection
8075
Layout.fillWidth: true
8176
header: qsTr("Connection")
82-
actionItem: Button {
83-
icon.source: "image://images/caret-right"
84-
icon.color: Theme.color.neutral9
85-
icon.height: 18
86-
icon.width: 18
87-
background: null
77+
actionItem: CaretRightButton {
78+
stateColor: gotoConnection.stateColor
8879
onClicked: {
8980
nodeSettingsView.push(connection_page)
9081
}

0 commit comments

Comments
 (0)