amount dialog: use show_max bool to decide wheather max_button is displayed
This commit is contained in:
parent
7b87a7f707
commit
6e45f42b19
|
@ -733,6 +733,16 @@ class ElectrumWindow(App):
|
|||
|
||||
def amount_dialog(self, label, callback):
|
||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/amount.kv')
|
||||
# Hide max_button
|
||||
show_max = False
|
||||
but_max = popup.ids.but_max
|
||||
if not show_max:
|
||||
but_max.disabled = True
|
||||
but_max.opacity = 0
|
||||
else:
|
||||
but_max.disabled = False
|
||||
but_max.opacity = 1
|
||||
|
||||
if label.text != label.default_text:
|
||||
a, u = label.text.split()
|
||||
assert u == self.base_unit
|
||||
|
@ -755,6 +765,3 @@ class ElectrumWindow(App):
|
|||
popup.open()
|
||||
else:
|
||||
apply(f, args + (None,))
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ Popup:
|
|||
text: '<'
|
||||
label: a
|
||||
Button:
|
||||
id: but_max
|
||||
size_hint: 1, None
|
||||
height: '48dp'
|
||||
text: 'Max'
|
||||
|
@ -86,4 +87,3 @@ Popup:
|
|||
height: '48dp'
|
||||
text: _('OK')
|
||||
on_release: popup.dismiss()
|
||||
|
||||
|
|
Loading…
Reference in New Issue