mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-29 08:21:27 +00:00
kivy: share with qr code on double tap
This commit is contained in:
parent
caccae222c
commit
34ddaaa419
4 changed files with 18 additions and 8 deletions
|
@ -128,11 +128,11 @@
|
||||||
<RefLabel@TopLabel>
|
<RefLabel@TopLabel>
|
||||||
font_size: '6pt'
|
font_size: '6pt'
|
||||||
ref_text: ''
|
ref_text: ''
|
||||||
text: '[ref=x]%s[/ref]' % self.ref_text
|
text: self.ref_text
|
||||||
padding: '10dp', '10dp'
|
padding: '10dp', '10dp'
|
||||||
on_ref_press:
|
on_touch_down:
|
||||||
app._clipboard.copy(self.ref_text)
|
touch = args[1]
|
||||||
app.show_info(_('Text copied to clipboard'))
|
if self.collide_point(*touch.pos): app.on_ref_label(self.ref_text, touch)
|
||||||
canvas.before:
|
canvas.before:
|
||||||
Color:
|
Color:
|
||||||
rgb: .3, .3, .3
|
rgb: .3, .3, .3
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
<TxHashLabel@RefLabel>
|
<TxHashLabel@RefLabel>
|
||||||
tx_hash: ''
|
tx_hash: ''
|
||||||
ref_text: self.tx_hash
|
ref_text: self.tx_hash
|
||||||
text: '[ref=x]%s[/ref]' %' '.join(map(''.join, zip(*[iter(self.tx_hash)]*4))) if self.tx_hash else ''
|
text: ' '.join(map(''.join, zip(*[iter(self.tx_hash)]*4))) if self.tx_hash else ''
|
||||||
|
|
||||||
<InfoBubble>
|
<InfoBubble>
|
||||||
size_hint: None, None
|
size_hint: None, None
|
||||||
|
|
|
@ -600,6 +600,13 @@ class ElectrumWindow(App):
|
||||||
self._orientation = 'landscape' if width > height else 'portrait'
|
self._orientation = 'landscape' if width > height else 'portrait'
|
||||||
self._ui_mode = 'tablet' if min(width, height) > inch(3.51) else 'phone'
|
self._ui_mode = 'tablet' if min(width, height) > inch(3.51) else 'phone'
|
||||||
|
|
||||||
|
def on_ref_label(self, text, touch):
|
||||||
|
if touch.is_double_tap:
|
||||||
|
self.qr_dialog(_('Share with QR Code'), text)
|
||||||
|
else:
|
||||||
|
self._clipboard.copy(text)
|
||||||
|
self.show_info(_('Text copied to clipboard'))
|
||||||
|
|
||||||
def set_send(self, address, amount, label, message):
|
def set_send(self, address, amount, label, message):
|
||||||
self.send_payment(address, amount=amount, label=label, message=message)
|
self.send_payment(address, amount=amount, label=label, message=message)
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ Builder.load_string('''
|
||||||
<QRDialog@Popup>
|
<QRDialog@Popup>
|
||||||
id: popup
|
id: popup
|
||||||
title: ''
|
title: ''
|
||||||
|
data: ''
|
||||||
shaded: False
|
shaded: False
|
||||||
AnchorLayout:
|
AnchorLayout:
|
||||||
anchor_x: 'center'
|
anchor_x: 'center'
|
||||||
|
@ -13,6 +14,8 @@ Builder.load_string('''
|
||||||
size_hint: 1, 1
|
size_hint: 1, 1
|
||||||
QRCodeWidget:
|
QRCodeWidget:
|
||||||
id: qr
|
id: qr
|
||||||
|
TopLabel:
|
||||||
|
text: root.data
|
||||||
Widget:
|
Widget:
|
||||||
size_hint: 1, 0.2
|
size_hint: 1, 0.2
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
|
|
|
@ -35,9 +35,10 @@ ReceiveScreen:
|
||||||
width: min(self.height, bl.width)
|
width: min(self.height, bl.width)
|
||||||
pos_hint: {'center': (.5, .5)}
|
pos_hint: {'center': (.5, .5)}
|
||||||
shaded: False
|
shaded: False
|
||||||
|
foreground_color: (0, 0, 0, 0.5) if self.shaded else (0, 0, 0, 0)
|
||||||
on_touch_down:
|
on_touch_down:
|
||||||
self.shaded = not self.shaded
|
touch = args[1]
|
||||||
self.foreground_color = (0, 0, 0, 0.5) if self.shaded else (0, 0, 0, 0)
|
if self.collide_point(*touch.pos): self.shaded = not self.shaded
|
||||||
Label:
|
Label:
|
||||||
text: root.status
|
text: root.status
|
||||||
opacity: 1 if root.status else 0
|
opacity: 1 if root.status else 0
|
||||||
|
@ -52,7 +53,6 @@ ReceiveScreen:
|
||||||
pos: self.pos
|
pos: self.pos
|
||||||
size: self.size
|
size: self.size
|
||||||
|
|
||||||
|
|
||||||
SendReceiveBlueBottom:
|
SendReceiveBlueBottom:
|
||||||
id: blue_bottom
|
id: blue_bottom
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
|
|
Loading…
Add table
Reference in a new issue