1
0

qml: mempool histogram color bar: show tooltips

to teach meanings of colours and positions in the bar
This commit is contained in:
SomberNight
2023-03-31 11:54:02 +00:00
parent f7e7b4c9db
commit 771ffa371c
2 changed files with 12 additions and 1 deletions

View File

@@ -91,6 +91,13 @@ Pane {
Layout.fillWidth: true
height: parent.height
color: Qt.hsva(2/3-(2/3*(Math.log(Math.min(600, modelData[0]))/Math.log(600))), 0.8, 1, 1)
ToolTip.text: modelData[0] + " sat/vB around depth " + (modelData[2]/1000000).toFixed(2) + " MB"
ToolTip.visible: ma.containsMouse
MouseArea {
id: ma
anchors.fill: parent
hoverEnabled: true
}
}
}
}

View File

@@ -126,7 +126,11 @@ class QENetwork(QObject, QtEventListener):
break
slot = min(item[1], bytes_limit-bytes_current)
bytes_current += slot
capped_histogram.append([max(FEERATE_DEFAULT_RELAY/1000, item[0]), slot]) # clamped to [FEERATE_DEFAULT_RELAY/1000,inf]
capped_histogram.append([
max(FEERATE_DEFAULT_RELAY/1000, item[0]), # clamped to [FEERATE_DEFAULT_RELAY/1000,inf[
slot, # width of bucket
bytes_current, # cumulative depth at far end of bucket
])
# add clamping attributes for the GUI
self._fee_histogram = {