1
0

qml: only show channel ratio bar when appropriate

This commit is contained in:
Sander van Grieken
2023-04-17 12:48:51 +02:00
parent 3be5db15d2
commit a1314f5992
3 changed files with 11 additions and 1 deletions

View File

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

View File

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

View File

@@ -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():