From 0fa582ddc899932675d1e592367fca01cb6fa2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Wed, 23 Aug 2023 23:07:38 +0100 Subject: [PATCH 1/2] qml: disable CaretRightButton --- src/qml/components/AboutOptions.qml | 11 ++--- src/qml/components/CaretRightButton.qml | 4 -- src/qml/components/ConnectionSettings.qml | 2 +- src/qml/pages/node/NodeSettings.qml | 56 ++++++++++------------ src/qml/pages/settings/SettingsDisplay.qml | 18 ++++--- 5 files changed, 39 insertions(+), 52 deletions(-) diff --git a/src/qml/components/AboutOptions.qml b/src/qml/components/AboutOptions.qml index f0f118f18d..5350c767da 100644 --- a/src/qml/components/AboutOptions.qml +++ b/src/qml/components/AboutOptions.qml @@ -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: CaretRightButton { + color: gotoDeveloper.stateColor + } + onClicked: { + aboutSwipe.incrementCurrentIndex() } - onClicked: loadedItem.clicked() } } diff --git a/src/qml/components/CaretRightButton.qml b/src/qml/components/CaretRightButton.qml index e1fae7475d..ff4fc940e7 100644 --- a/src/qml/components/CaretRightButton.qml +++ b/src/qml/components/CaretRightButton.qml @@ -7,10 +7,6 @@ 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 } diff --git a/src/qml/components/ConnectionSettings.qml b/src/qml/components/ConnectionSettings.qml index 6a59eceae1..26640e0f6a 100644 --- a/src/qml/components/ConnectionSettings.qml +++ b/src/qml/components/ConnectionSettings.qml @@ -67,7 +67,7 @@ ColumnLayout { Layout.fillWidth: true header: qsTr("Proxy settings") actionItem: CaretRightButton { - stateColor: gotoProxy.stateColor + color: gotoProxy.stateColor } onClicked: connectionSwipe.incrementCurrentIndex() } diff --git a/src/qml/pages/node/NodeSettings.qml b/src/qml/pages/node/NodeSettings.qml index f66ed73303..6c99f77d3f 100644 --- a/src/qml/pages/node/NodeSettings.qml +++ b/src/qml/pages/node/NodeSettings.qml @@ -42,12 +42,11 @@ Item { Layout.fillWidth: true header: qsTr("About") actionItem: CaretRightButton { - stateColor: gotoAbout.stateColor - onClicked: { - nodeSettingsView.push(about_page) - } + color: gotoAbout.stateColor + } + onClicked: { + nodeSettingsView.push(about_page) } - onClicked: loadedItem.clicked() } Separator { Layout.fillWidth: true } Setting { @@ -55,12 +54,11 @@ Item { Layout.fillWidth: true header: qsTr("Display") actionItem: CaretRightButton { - stateColor: gotoDisplay.stateColor - onClicked: { - nodeSettingsView.push(display_page) - } + color: gotoDisplay.stateColor + } + onClicked: { + nodeSettingsView.push(display_page) } - onClicked: loadedItem.clicked() } Separator { Layout.fillWidth: true } Setting { @@ -68,12 +66,11 @@ Item { Layout.fillWidth: true header: qsTr("Storage") actionItem: CaretRightButton { - stateColor: gotoStorage.stateColor - onClicked: { - nodeSettingsView.push(storage_page) - } + color: gotoStorage.stateColor + } + onClicked: { + nodeSettingsView.push(storage_page) } - onClicked: loadedItem.clicked() } Separator { Layout.fillWidth: true } Setting { @@ -81,12 +78,11 @@ Item { Layout.fillWidth: true header: qsTr("Connection") actionItem: CaretRightButton { - stateColor: gotoConnection.stateColor - onClicked: { - nodeSettingsView.push(connection_page) - } + color: gotoConnection.stateColor + } + onClicked: { + nodeSettingsView.push(connection_page) } - onClicked: loadedItem.clicked() } Separator { Layout.fillWidth: true } Setting { @@ -94,13 +90,12 @@ Item { Layout.fillWidth: true header: qsTr("Peers") actionItem: CaretRightButton { - stateColor: gotoPeers.stateColor - onClicked: { - peerTableModel.startAutoRefresh(); - nodeSettingsView.push(peers_page) - } + color: gotoPeers.stateColor + } + onClicked: { + peerTableModel.startAutoRefresh(); + nodeSettingsView.push(peers_page) } - onClicked: loadedItem.clicked() } Separator { Layout.fillWidth: true } Setting { @@ -108,12 +103,11 @@ Item { Layout.fillWidth: true header: qsTr("Network Traffic") actionItem: CaretRightButton { - stateColor: gotoNetworkTraffic.stateColor - onClicked: { - nodeSettingsView.push(networktraffic_page) - } + color: gotoNetworkTraffic.stateColor + } + onClicked: { + nodeSettingsView.push(networktraffic_page) } - onClicked: loadedItem.clicked() } } } diff --git a/src/qml/pages/settings/SettingsDisplay.qml b/src/qml/pages/settings/SettingsDisplay.qml index 2a9d0b9ffe..28c5609601 100644 --- a/src/qml/pages/settings/SettingsDisplay.qml +++ b/src/qml/pages/settings/SettingsDisplay.qml @@ -41,12 +41,11 @@ Item { Layout.fillWidth: true header: qsTr("Theme") actionItem: CaretRightButton { - stateColor: gotoTheme.stateColor - onClicked: { - nodeSettingsView.push(theme_page) - } + color: gotoTheme.stateColor + } + onClicked: { + nodeSettingsView.push(theme_page) } - onClicked: loadedItem.clicked() } Separator { Layout.fillWidth: true } Setting { @@ -54,12 +53,11 @@ Item { Layout.fillWidth: true header: qsTr("Block clock display mode") actionItem: CaretRightButton { - stateColor: gotoBlockClockSize.stateColor - onClicked: { - nodeSettingsView.push(blockclocksize_page) - } + color: gotoBlockClockSize.stateColor + } + onClicked: { + nodeSettingsView.push(blockclocksize_page) } - onClicked: loadedItem.clicked() } } } From 74d4a9740a39720fb001716c1f9b4ed7eaf8f3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Wed, 23 Aug 2023 23:16:17 +0100 Subject: [PATCH 2/2] qml: rename to CaretRightIcon --- src/Makefile.qt.include | 2 +- src/qml/bitcoin_qml.qrc | 2 +- src/qml/components/AboutOptions.qml | 2 +- src/qml/components/ConnectionSettings.qml | 2 +- .../CaretRightIcon.qml} | 1 - src/qml/pages/node/NodeSettings.qml | 12 ++++++------ src/qml/pages/settings/SettingsDisplay.qml | 4 ++-- 7 files changed, 12 insertions(+), 13 deletions(-) rename src/qml/{components/CaretRightButton.qml => controls/CaretRightIcon.qml} (93%) diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index ba032ee58f..79a6fc2473 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -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 \ diff --git a/src/qml/bitcoin_qml.qrc b/src/qml/bitcoin_qml.qrc index 44e0448884..497df101d8 100644 --- a/src/qml/bitcoin_qml.qrc +++ b/src/qml/bitcoin_qml.qrc @@ -4,7 +4,7 @@ components/BlockClock.qml components/BlockClockDisplayMode.qml components/BlockCounter.qml - components/CaretRightButton.qml + controls/CaretRightIcon.qml components/ConnectionOptions.qml components/ConnectionSettings.qml components/PeersIndicator.qml diff --git a/src/qml/components/AboutOptions.qml b/src/qml/components/AboutOptions.qml index 5350c767da..55123f577d 100644 --- a/src/qml/components/AboutOptions.qml +++ b/src/qml/components/AboutOptions.qml @@ -65,7 +65,7 @@ ColumnLayout { Layout.fillWidth: true header: qsTr("Developer options") description: qsTr("Only use these if you have development experience") - actionItem: CaretRightButton { + actionItem: CaretRightIcon { color: gotoDeveloper.stateColor } onClicked: { diff --git a/src/qml/components/ConnectionSettings.qml b/src/qml/components/ConnectionSettings.qml index 26640e0f6a..90625a7def 100644 --- a/src/qml/components/ConnectionSettings.qml +++ b/src/qml/components/ConnectionSettings.qml @@ -66,7 +66,7 @@ ColumnLayout { id: gotoProxy Layout.fillWidth: true header: qsTr("Proxy settings") - actionItem: CaretRightButton { + actionItem: CaretRightIcon { color: gotoProxy.stateColor } onClicked: connectionSwipe.incrementCurrentIndex() diff --git a/src/qml/components/CaretRightButton.qml b/src/qml/controls/CaretRightIcon.qml similarity index 93% rename from src/qml/components/CaretRightButton.qml rename to src/qml/controls/CaretRightIcon.qml index ff4fc940e7..fe39d43c11 100644 --- a/src/qml/components/CaretRightButton.qml +++ b/src/qml/controls/CaretRightIcon.qml @@ -4,7 +4,6 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import "../controls" Icon { source: "image://images/caret-right" diff --git a/src/qml/pages/node/NodeSettings.qml b/src/qml/pages/node/NodeSettings.qml index 6c99f77d3f..bdf10c4cb7 100644 --- a/src/qml/pages/node/NodeSettings.qml +++ b/src/qml/pages/node/NodeSettings.qml @@ -41,7 +41,7 @@ Item { id: gotoAbout Layout.fillWidth: true header: qsTr("About") - actionItem: CaretRightButton { + actionItem: CaretRightIcon { color: gotoAbout.stateColor } onClicked: { @@ -53,7 +53,7 @@ Item { id: gotoDisplay Layout.fillWidth: true header: qsTr("Display") - actionItem: CaretRightButton { + actionItem: CaretRightIcon { color: gotoDisplay.stateColor } onClicked: { @@ -65,7 +65,7 @@ Item { id: gotoStorage Layout.fillWidth: true header: qsTr("Storage") - actionItem: CaretRightButton { + actionItem: CaretRightIcon { color: gotoStorage.stateColor } onClicked: { @@ -77,7 +77,7 @@ Item { id: gotoConnection Layout.fillWidth: true header: qsTr("Connection") - actionItem: CaretRightButton { + actionItem: CaretRightIcon { color: gotoConnection.stateColor } onClicked: { @@ -89,7 +89,7 @@ Item { id: gotoPeers Layout.fillWidth: true header: qsTr("Peers") - actionItem: CaretRightButton { + actionItem: CaretRightIcon { color: gotoPeers.stateColor } onClicked: { @@ -102,7 +102,7 @@ Item { id: gotoNetworkTraffic Layout.fillWidth: true header: qsTr("Network Traffic") - actionItem: CaretRightButton { + actionItem: CaretRightIcon { color: gotoNetworkTraffic.stateColor } onClicked: { diff --git a/src/qml/pages/settings/SettingsDisplay.qml b/src/qml/pages/settings/SettingsDisplay.qml index 28c5609601..97455a51bd 100644 --- a/src/qml/pages/settings/SettingsDisplay.qml +++ b/src/qml/pages/settings/SettingsDisplay.qml @@ -40,7 +40,7 @@ Item { id: gotoTheme Layout.fillWidth: true header: qsTr("Theme") - actionItem: CaretRightButton { + actionItem: CaretRightIcon { color: gotoTheme.stateColor } onClicked: { @@ -52,7 +52,7 @@ Item { id: gotoBlockClockSize Layout.fillWidth: true header: qsTr("Block clock display mode") - actionItem: CaretRightButton { + actionItem: CaretRightIcon { color: gotoBlockClockSize.stateColor } onClicked: {