Browse Source

qml: only show channel ratio bar when appropriate

master
Sander van Grieken 3 years ago
parent
commit
a1314f5992
  1. 6
      electrum/gui/qml/components/ChannelDetails.qml
  2. 2
      electrum/gui/qml/components/controls/ChannelDelegate.qml
  3. 4
      electrum/gui/qml/qechanneldetails.py

6
electrum/gui/qml/components/ChannelDetails.qml

@ -61,6 +61,7 @@ Pane {
}
Label {
Layout.fillWidth: true
text: channeldetails.short_cid
}
@ -77,11 +78,13 @@ Pane {
}
Label {
visible: !channeldetails.isBackup
text: qsTr('Initiator')
color: Material.accentColor
}
Label {
visible: !channeldetails.isBackup
text: channeldetails.initiator
}
@ -146,6 +149,9 @@ Pane {
Layout.fillWidth: true
Layout.topMargin: constants.paddingLarge
Layout.bottomMargin: constants.paddingXLarge
visible: channeldetails.stateCode != ChannelDetails.Redeemed
&& channeldetails.stateCode != ChannelDetails.Closed
&& !channeldetails.isBackup
capacity: channeldetails.capacity
localCapacity: channeldetails.localCapacity
remoteCapacity: channeldetails.remoteCapacity

2
electrum/gui/qml/components/controls/ChannelDelegate.qml

@ -107,7 +107,7 @@ ItemDelegate {
ChannelBar {
Layout.fillWidth: true
visible: !_closed
visible: !_closed && !model.is_backup
capacity: model.capacity
localCapacity: model.local_capacity
remoteCapacity: model.remote_capacity

4
electrum/gui/qml/qechanneldetails.py

@ -99,6 +99,10 @@ class QEChannelDetails(QObject, QtEventListener):
def state(self):
return self._channel.get_state_for_GUI()
@pyqtProperty(int, notify=channelChanged)
def stateCode(self):
return self._channel.get_state()
@pyqtProperty(str, notify=channelChanged)
def initiator(self):
if self._channel.is_backup():

Loading…
Cancel
Save