Skip to content

Commit

Permalink
Merge #356: CaretRightIcon control
Browse files Browse the repository at this point in the history
74d4a97 qml: rename to CaretRightIcon (João Barbosa)
0fa582d qml: disable CaretRightButton (João Barbosa)

Pull request description:

  Replace `CaretRightButton` with a more appropriate `CaretRightIcon`, and refactor the `clicked` signed.

  This also is a step towards removing the `loadedItem` property from `Setting`.

ACKs for top commit:
  jarolrod:
    ACK 74d4a97

Tree-SHA512: 59991b6d0a3a851b09cda542b9fc5db70a2da71cbae68e9f090b48c3598d445bf6ff80f25a37144d00dbefca21395a0a9ee73150adb9cad11199499a254ef4dd
  • Loading branch information
hebasto committed Sep 7, 2023
2 parents abd3ba1 + 74d4a97 commit fd0979d
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 64 deletions.
2 changes: 1 addition & 1 deletion src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ QML_RES_QML = \
qml/components/BlockClock.qml \
qml/components/BlockClockDisplayMode.qml \
qml/components/BlockCounter.qml \
qml/components/CaretRightButton.qml \
qml/controls/CaretRightIcon.qml \
qml/components/ConnectionOptions.qml \
qml/components/ConnectionSettings.qml \
qml/components/DeveloperOptions.qml \
Expand Down
2 changes: 1 addition & 1 deletion src/qml/bitcoin_qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<file>components/BlockClock.qml</file>
<file>components/BlockClockDisplayMode.qml</file>
<file>components/BlockCounter.qml</file>
<file>components/CaretRightButton.qml</file>
<file>controls/CaretRightIcon.qml</file>
<file>components/ConnectionOptions.qml</file>
<file>components/ConnectionSettings.qml</file>
<file>components/PeersIndicator.qml</file>
Expand Down
11 changes: 5 additions & 6 deletions src/qml/components/AboutOptions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ ColumnLayout {
Layout.fillWidth: true
header: qsTr("Developer options")
description: qsTr("Only use these if you have development experience")
actionItem: CaretRightButton{
stateColor: gotoDeveloper.stateColor
onClicked: {
aboutSwipe.incrementCurrentIndex()
}
actionItem: CaretRightIcon {
color: gotoDeveloper.stateColor
}
onClicked: {
aboutSwipe.incrementCurrentIndex()
}
onClicked: loadedItem.clicked()
}
}
4 changes: 2 additions & 2 deletions src/qml/components/ConnectionSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ ColumnLayout {
id: gotoProxy
Layout.fillWidth: true
header: qsTr("Proxy settings")
actionItem: CaretRightButton {
stateColor: gotoProxy.stateColor
actionItem: CaretRightIcon {
color: gotoProxy.stateColor
}
onClicked: connectionSwipe.incrementCurrentIndex()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@

import QtQuick 2.15
import QtQuick.Controls 2.15
import "../controls"

Icon {
id: root
required property color stateColor
enabled: true
source: "image://images/caret-right"
color: root.stateColor
size: 18
}
68 changes: 31 additions & 37 deletions src/qml/pages/node/NodeSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,79 +41,73 @@ Item {
id: gotoAbout
Layout.fillWidth: true
header: qsTr("About")
actionItem: CaretRightButton {
stateColor: gotoAbout.stateColor
onClicked: {
nodeSettingsView.push(about_page)
}
actionItem: CaretRightIcon {
color: gotoAbout.stateColor
}
onClicked: {
nodeSettingsView.push(about_page)
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoDisplay
Layout.fillWidth: true
header: qsTr("Display")
actionItem: CaretRightButton {
stateColor: gotoDisplay.stateColor
onClicked: {
nodeSettingsView.push(display_page)
}
actionItem: CaretRightIcon {
color: gotoDisplay.stateColor
}
onClicked: {
nodeSettingsView.push(display_page)
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoStorage
Layout.fillWidth: true
header: qsTr("Storage")
actionItem: CaretRightButton {
stateColor: gotoStorage.stateColor
onClicked: {
nodeSettingsView.push(storage_page)
}
actionItem: CaretRightIcon {
color: gotoStorage.stateColor
}
onClicked: {
nodeSettingsView.push(storage_page)
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoConnection
Layout.fillWidth: true
header: qsTr("Connection")
actionItem: CaretRightButton {
stateColor: gotoConnection.stateColor
onClicked: {
nodeSettingsView.push(connection_page)
}
actionItem: CaretRightIcon {
color: gotoConnection.stateColor
}
onClicked: {
nodeSettingsView.push(connection_page)
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoPeers
Layout.fillWidth: true
header: qsTr("Peers")
actionItem: CaretRightButton {
stateColor: gotoPeers.stateColor
onClicked: {
peerTableModel.startAutoRefresh();
nodeSettingsView.push(peers_page)
}
actionItem: CaretRightIcon {
color: gotoPeers.stateColor
}
onClicked: {
peerTableModel.startAutoRefresh();
nodeSettingsView.push(peers_page)
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoNetworkTraffic
Layout.fillWidth: true
header: qsTr("Network Traffic")
actionItem: CaretRightButton {
stateColor: gotoNetworkTraffic.stateColor
onClicked: {
nodeSettingsView.push(networktraffic_page)
}
actionItem: CaretRightIcon {
color: gotoNetworkTraffic.stateColor
}
onClicked: {
nodeSettingsView.push(networktraffic_page)
}
onClicked: loadedItem.clicked()
}
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/qml/pages/settings/SettingsDisplay.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,24 @@ Item {
id: gotoTheme
Layout.fillWidth: true
header: qsTr("Theme")
actionItem: CaretRightButton {
stateColor: gotoTheme.stateColor
onClicked: {
nodeSettingsView.push(theme_page)
}
actionItem: CaretRightIcon {
color: gotoTheme.stateColor
}
onClicked: {
nodeSettingsView.push(theme_page)
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoBlockClockSize
Layout.fillWidth: true
header: qsTr("Block clock display mode")
actionItem: CaretRightButton {
stateColor: gotoBlockClockSize.stateColor
onClicked: {
nodeSettingsView.push(blockclocksize_page)
}
actionItem: CaretRightIcon {
color: gotoBlockClockSize.stateColor
}
onClicked: {
nodeSettingsView.push(blockclocksize_page)
}
onClicked: loadedItem.clicked()
}
}
}
Expand Down

0 comments on commit fd0979d

Please sign in to comment.