Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui: add Clock icon in the nav bar refs #393 #436

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 42 additions & 9 deletions src/qml/pages/wallet/DesktopWallets.qml
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,59 @@ Page {
Layout.preferredWidth: 30
Layout.rightMargin: 10
property int index: 3
ButtonGroup.group: navigationTabs
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")
Expand Down