mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-02 18:25:21 +00:00
kivy: fix can_pay in invoice_dialog
This commit is contained in:
parent
a4944cdcb2
commit
e35bddcc09
1 changed files with 3 additions and 4 deletions
|
@ -21,6 +21,7 @@ Builder.load_string('''
|
|||
data: ''
|
||||
status_color: 1,1,1,1
|
||||
status_str:''
|
||||
can_pay: True
|
||||
shaded: False
|
||||
show_text: False
|
||||
AnchorLayout:
|
||||
|
@ -60,7 +61,7 @@ Builder.load_string('''
|
|||
height: '48dp'
|
||||
text: _('Pay')
|
||||
on_release: root.do_pay()
|
||||
disabled: not root.can_pay()
|
||||
disabled: not root.can_pay
|
||||
''')
|
||||
|
||||
class InvoiceDialog(Factory.Popup):
|
||||
|
@ -73,13 +74,11 @@ class InvoiceDialog(Factory.Popup):
|
|||
self.data = data
|
||||
self.key = key
|
||||
|
||||
def can_pay(self):
|
||||
return self.status == PR_UNPAID
|
||||
|
||||
def set_status(self, status):
|
||||
self.status = status
|
||||
self.status_str = pr_tooltips[status]
|
||||
self.status_color = pr_color[status]
|
||||
self.can_pay = self.status == PR_UNPAID
|
||||
|
||||
def on_dismiss(self):
|
||||
self.app.request_popup = None
|
||||
|
|
Loading…
Add table
Reference in a new issue