Browse Source

qml: mempool histogram color bar: show tooltips

to teach meanings of colours and positions in the bar
master
SomberNight 3 years ago
parent
commit
771ffa371c
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 7
      electrum/gui/qml/components/NetworkOverview.qml
  2. 6
      electrum/gui/qml/qenetwork.py

7
electrum/gui/qml/components/NetworkOverview.qml

@ -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
}
}
}
}

6
electrum/gui/qml/qenetwork.py

@ -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 = {

Loading…
Cancel
Save