1
0

kivy: add OutputList class

This commit is contained in:
ThomasV
2016-02-17 11:40:05 +01:00
parent c2d3968ebe
commit 74c9a05757
5 changed files with 45 additions and 29 deletions

View File

@@ -189,3 +189,26 @@ class InfoBubble(Factory.Bubble):
anim.bind(on_complete=on_stop)
anim.cancel_all(self)
anim.start(self)
class OutputList(Factory.GridLayout):
def __init__(self, **kwargs):
super(Factory.GridLayout, self).__init__(**kwargs)
self.app = App.get_running_app()
def add_output(self, address, amount):
t = Factory.CardLabel(text = '[ref=%s]%s[/ref]'%(address,address), font_size = '6pt')
t.shorten = True
t.size_hint_x = 0.65
t.on_ref_press = self.do_copy_address
self.add_widget(t)
t = Factory.CardLabel(text = self.app.format_amount_and_units(amount), font_size='6pt')
t.size_hint_x = 0.35
t.halign = 'right'
self.add_widget(t)
def do_copy_address(self, text):
self.app._clipboard.copy(text)
self.app.show_info(_('Address copied to clipboard') + ' ' + text)