From eda34e29b1727f647f1523f6001b18e4b499b9ae Mon Sep 17 00:00:00 2001 From: ciegovolador Date: Mon, 25 Nov 2024 11:22:43 -0300 Subject: [PATCH 1/2] fix: add Clock icon in the nav bar refs #393 --- src/qml/pages/wallet/DesktopWallets.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qml/pages/wallet/DesktopWallets.qml b/src/qml/pages/wallet/DesktopWallets.qml index 59a7ac15e4..d8f2b70fd4 100644 --- a/src/qml/pages/wallet/DesktopWallets.qml +++ b/src/qml/pages/wallet/DesktopWallets.qml @@ -74,6 +74,7 @@ Page { Layout.rightMargin: 10 property int index: 3 ButtonGroup.group: navigationTabs + iconSource: Theme.image.blocktime Tooltip { id: blockClockTooltip From 2c8407f5d8b07a207b0511a78546bfd789c9028b Mon Sep 17 00:00:00 2001 From: ciegovolador Date: Wed, 27 Nov 2024 15:32:10 -0300 Subject: [PATCH 2/2] gui: DRAFT using component as clock icon in navbar --- src/qml/pages/wallet/DesktopWallets.qml | 52 ++++++++++++++++++++----- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/src/qml/pages/wallet/DesktopWallets.qml b/src/qml/pages/wallet/DesktopWallets.qml index d8f2b70fd4..a844090366 100644 --- a/src/qml/pages/wallet/DesktopWallets.qml +++ b/src/qml/pages/wallet/DesktopWallets.qml @@ -73,27 +73,59 @@ Page { Layout.preferredWidth: 30 Layout.rightMargin: 10 property int index: 3 - ButtonGroup.group: navigationTabs - iconSource: Theme.image.blocktime + property var syncState: Utils.formatRemainingSyncTime(nodeModel.remainingSyncTime) + property bool synced: nodeModel.verificationProgress > 0.9999 + property bool paused: nodeModel.pause + property bool connected: nodeModel.numOutboundPeers > 0 + ButtonGroup.group: navigationTabs + property bool estimating: syncState.estimating + property bool faulted: nodeModel.faulted + + + BlockClockDial { + anchors.horizontalCenter: blockClockTabButton.horizontalCenter + scale: Theme.blockclocksize + width: blockClockTabButton.width + height: width * 2 + penWidth: width / 20 + timeRatioList: chainModel.timeRatioList + verificationProgress: nodeModel.verificationProgress + paused: blockClockTabButton.paused || blockClockTabButton.faulted + connected: blockClockTabButton.connected + synced: nodeModel.verificationProgress > 0.999 + backgroundColor: Theme.color.neutral2 + timeTickColor: Theme.color.neutral5 + confirmationColors: Theme.color.confirmationColors + + + Behavior on backgroundColor { + ColorAnimation { duration: 150 } + } + + Behavior on timeTickColor { + ColorAnimation { duration: 150 } + } + + Behavior on confirmationColors { + ColorAnimation { duration: 150 } + } + } + + Tooltip { id: blockClockTooltip - property var syncState: Utils.formatRemainingSyncTime(nodeModel.remainingSyncTime) - property bool synced: nodeModel.verificationProgress > 0.9999 - property bool paused: nodeModel.pause - property bool connected: nodeModel.numOutboundPeers > 0 - anchors.top: blockClockTabButton.bottom anchors.topMargin: -5 anchors.horizontalCenter: blockClockTabButton.horizontalCenter visible: blockClockTabButton.hovered text: { - if (paused) { + if (blockClockTabButton.paused) { qsTr("Paused") - } else if (connected && synced) { + } else if (blockClockTabButton.connected && blockClockTabButton.synced) { qsTr("Blocktime\n" + Number(nodeModel.blockTipHeight).toLocaleString(Qt.locale(), 'f', 0)) - } else if (connected){ + } else if (blockClockTabButton.connected){ qsTr("Downloading blocks\n" + syncState.text) } else { qsTr("Connecting")