kivy: add context button for tx details
This commit is contained in:
parent
9b2885e697
commit
2f13910bf1
|
@ -353,6 +353,16 @@ BoxLayout:
|
|||
.format(app.status)
|
||||
font_size: '22dp'
|
||||
minimum_width: '1dp'
|
||||
on_release:
|
||||
app.context_action()
|
||||
|
||||
ActionButton:
|
||||
id: context_button
|
||||
text: app.context
|
||||
width: 0
|
||||
on_text:
|
||||
self.width = 20 if self.text else 0
|
||||
on_release: app.context_action()
|
||||
|
||||
ActionOverflow:
|
||||
id: ao
|
||||
|
|
|
@ -76,8 +76,9 @@ class ElectrumWindow(App):
|
|||
keys = sorted(base_units.keys())
|
||||
self.base_unit = keys[ (keys.index(self.base_unit) + 1) % len(keys)]
|
||||
|
||||
context = StringProperty('')
|
||||
context_action = lambda: None
|
||||
status = StringProperty(_('Not Connected'))
|
||||
|
||||
fiat_unit = StringProperty('')
|
||||
|
||||
def decimal_point(self):
|
||||
|
@ -759,6 +760,17 @@ class ElectrumWindow(App):
|
|||
popup.tx_hash = tx_hash
|
||||
popup.open()
|
||||
|
||||
def tx_selected(self, txid, state):
|
||||
if state == 'down':
|
||||
self.context = 'tx'
|
||||
self.context_action = lambda: self.tx_dialog(txid)
|
||||
else:
|
||||
self.reset_context()
|
||||
|
||||
def reset_context(self):
|
||||
self.context = ''
|
||||
self.context_action = lambda: None
|
||||
|
||||
def amount_dialog(self, screen, show_max):
|
||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/amount.kv')
|
||||
but_max = popup.ids.but_max
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
size: self.texture_size[0] + dp(32), self.texture_size[1] + dp(7)
|
||||
|
||||
|
||||
<CardItem@ButtonBehavior+GridLayout>
|
||||
<CardItem@ToggleButtonBehavior+GridLayout>
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0.192, .498, 0.745, 1 if self.state == 'down' else 0
|
||||
|
@ -50,6 +50,7 @@
|
|||
spacing: '2dp'
|
||||
size_hint: 1, None
|
||||
height: self.minimum_height
|
||||
group: 'history'
|
||||
|
||||
<RecentActivityItem@CardItem>
|
||||
icon: 'atlas://gui/kivy/theming/light/important'
|
||||
|
@ -60,10 +61,9 @@
|
|||
confirmations: 0
|
||||
date: '0/0/0'
|
||||
quote_text: '.'
|
||||
|
||||
spacing: '9dp'
|
||||
on_release:
|
||||
app.tx_dialog(root.tx_hash)
|
||||
app.tx_selected(root.tx_hash, self.state)
|
||||
BoxLayout:
|
||||
size_hint: 1, None
|
||||
spacing: '8dp'
|
||||
|
|
Loading…
Reference in New Issue