kivy: add camera as IconButton
This commit is contained in:
parent
a2ea8db998
commit
fe2fdfe400
|
@ -37,6 +37,21 @@
|
|||
size_hint: 1, None
|
||||
height: self.minimum_height
|
||||
|
||||
|
||||
|
||||
<IconButton@Button>:
|
||||
icon: ''
|
||||
AnchorLayout:
|
||||
pos: self.parent.pos
|
||||
size: self.parent.size
|
||||
orientation: 'lr-tb'
|
||||
Image:
|
||||
source: self.parent.parent.icon
|
||||
size_hint_x: None
|
||||
size: '30dp', '30dp'
|
||||
|
||||
|
||||
|
||||
#########################
|
||||
# Dialogs
|
||||
#########################
|
||||
|
|
|
@ -269,6 +269,8 @@ class ElectrumWindow(App):
|
|||
self.switch_to('receive')
|
||||
|
||||
def scan_qr(self, on_complete):
|
||||
if platform != 'android':
|
||||
return
|
||||
from jnius import autoclass
|
||||
from android import activity
|
||||
PythonActivity = autoclass('org.renpy.android.PythonActivity')
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 468 KiB After Width: | Height: | Size: 470 KiB |
|
@ -1 +1 @@
|
|||
{"light-0.png": {"closebutton": [964, 855, 60, 43], "card_top": [964, 786, 32, 16], "tab_btn_disabled": [788, 483, 32, 32], "tab_btn_pressed": [856, 483, 32, 32], "bit_logo": [396, 407, 44, 51], "globe": [821, 628, 72, 72], "btn_send_nfc": [755, 290, 18, 15], "shadow_right": [895, 629, 32, 5], "logo_atom_dull": [654, 715, 64, 64], "action_group_light": [396, 357, 33, 48], "tab": [918, 715, 64, 64], "logo": [815, 906, 128, 116], "qrcode": [2, 194, 145, 145], "close": [641, 612, 88, 88], "btn_create_act_disabled": [754, 483, 32, 32], "white_bg_round_top": [956, 495, 31, 20], "card_bottom": [989, 499, 32, 16], "confirmed": [390, 715, 64, 64], "overflow_btn_dn": [995, 519, 16, 10], "carousel_deselected": [895, 636, 64, 64], "network": [556, 225, 48, 48], "blue_bg_round_rb": [890, 495, 31, 20], "dropdown_background": [659, 238, 29, 35], "action_bar": [945, 907, 36, 36], "pen": [786, 715, 64, 64], "overflow_background": [690, 238, 29, 35], "arrow_back": [971, 531, 50, 50], "clock3": [839, 517, 64, 64], "contact": [641, 466, 49, 49], "star_big_inactive": [296, 211, 128, 128], "lightblue_bg_round_lb": [923, 495, 31, 20], "manualentry": [149, 205, 145, 134], "stepper_restore_password": [247, 464, 392, 117], "tab_disabled": [755, 307, 96, 32], "mail_icon": [622, 285, 65, 54], "tab_strip": [853, 307, 96, 32], "tab_btn": [822, 483, 32, 32], "btn_create_account": [951, 307, 64, 32], "btn_send_address": [998, 787, 18, 15], "add_contact": [606, 230, 51, 43], "gear": [2, 33, 105, 159], "wallets": [692, 475, 60, 40], "stepper_left": [247, 583, 392, 117], "nfc_stage_one": [324, 900, 489, 122], "nfc_clock": [2, 460, 243, 240], "btn_nfc": [821, 614, 13, 12], "textinput_active": [848, 784, 114, 114], "clock2": [773, 517, 64, 64], "nfc_phone": [426, 213, 128, 126], "clock4": [905, 517, 64, 64], "paste_icon": [945, 945, 75, 77], "shadow": [852, 715, 64, 64], "carousel_selected": [641, 517, 64, 64], "card": [689, 290, 64, 49], "unconfirmed": [556, 275, 64, 64], "info": [588, 715, 64, 64], "electrum_icon640": [2, 702, 320, 320], "action_button_group": [1008, 719, 16, 10], "action_group_dark": [984, 731, 33, 48], "nfc": [720, 715, 64, 64], "contact_avatar": [964, 804, 49, 49], "clock1": [707, 517, 64, 64], "create_act_text_active": [984, 719, 22, 10], "icon_border": [522, 715, 64, 64], "stepper_full": [324, 781, 392, 117], "card_btn": [983, 911, 38, 32], "wallet": [442, 414, 49, 44], "important": [731, 612, 88, 88], "dialog": [641, 590, 18, 20], "error": [718, 784, 128, 114], "stepper_restore_seed": [2, 341, 392, 117], "contact_overlay": [456, 715, 64, 64], "settings": [961, 636, 54, 64], "create_act_text": [971, 519, 22, 10], "clock5": [324, 715, 64, 64]}}
|
||||
{"light-0.png": {"closebutton": [964, 855, 60, 43], "card_top": [707, 594, 32, 16], "tab_btn_disabled": [900, 483, 32, 32], "tab_btn_pressed": [934, 483, 32, 32], "bit_logo": [396, 407, 44, 51], "globe": [821, 628, 72, 72], "btn_send_nfc": [821, 290, 18, 15], "shadow_right": [971, 524, 32, 5], "logo_atom_dull": [720, 715, 64, 64], "create_act_text_active": [968, 483, 22, 10], "action_group_light": [396, 357, 33, 48], "tab": [556, 275, 64, 64], "logo": [815, 906, 128, 116], "qrcode": [2, 194, 145, 145], "close": [641, 612, 88, 88], "btn_create_act_disabled": [832, 483, 32, 32], "white_bg_round_top": [674, 590, 31, 20], "card_bottom": [964, 786, 32, 16], "confirmed": [456, 715, 64, 64], "overflow_btn_dn": [992, 483, 16, 10], "carousel_deselected": [641, 517, 64, 64], "network": [556, 225, 48, 48], "blue_bg_round_rb": [968, 495, 31, 20], "dropdown_background": [659, 238, 29, 35], "action_bar": [754, 479, 36, 36], "pen": [852, 715, 64, 64], "overflow_background": [690, 238, 29, 35], "contact": [964, 804, 49, 49], "arrow_back": [971, 531, 50, 50], "clock3": [905, 517, 64, 64], "camera": [895, 636, 64, 64], "star_big_inactive": [296, 211, 128, 128], "lightblue_bg_round_lb": [641, 590, 31, 20], "manualentry": [149, 205, 145, 134], "stepper_restore_password": [247, 464, 392, 117], "tab_disabled": [821, 307, 96, 32], "mail_icon": [688, 285, 65, 54], "tab_strip": [919, 307, 96, 32], "tab_btn": [866, 483, 32, 32], "btn_create_account": [945, 911, 64, 32], "btn_send_address": [998, 787, 18, 15], "add_contact": [606, 230, 51, 43], "gear": [2, 33, 105, 159], "wallets": [692, 475, 60, 40], "stepper_left": [247, 583, 392, 117], "nfc_stage_one": [324, 900, 489, 122], "nfc_clock": [2, 460, 243, 240], "btn_nfc": [1011, 931, 13, 12], "textinput_active": [848, 784, 114, 114], "clock2": [839, 517, 64, 64], "nfc_phone": [426, 213, 128, 126], "clock4": [324, 715, 64, 64], "paste_icon": [945, 945, 75, 77], "shadow": [918, 715, 64, 64], "carousel_selected": [707, 517, 64, 64], "card": [755, 290, 64, 49], "unconfirmed": [622, 275, 64, 64], "info": [654, 715, 64, 64], "electrum_icon640": [2, 702, 320, 320], "action_button_group": [1008, 719, 16, 10], "action_group_dark": [984, 731, 33, 48], "nfc": [786, 715, 64, 64], "contact_avatar": [641, 466, 49, 49], "clock1": [773, 517, 64, 64], "create_act_text": [984, 719, 22, 10], "icon_border": [588, 715, 64, 64], "stepper_full": [324, 781, 392, 117], "card_btn": [792, 483, 38, 32], "wallet": [442, 414, 49, 44], "important": [731, 612, 88, 88], "dialog": [1001, 495, 18, 20], "error": [718, 784, 128, 114], "stepper_restore_seed": [2, 341, 392, 117], "contact_overlay": [522, 715, 64, 64], "settings": [961, 636, 54, 64], "clock5": [390, 715, 64, 64]}}
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -174,10 +174,10 @@ Builder.load_string('''
|
|||
id: back
|
||||
text: _('Back')
|
||||
root: root
|
||||
Button:
|
||||
IconButton:
|
||||
id: scan
|
||||
text: _('QR')
|
||||
on_release: root.scan_seed()
|
||||
icon: 'atlas://gui/kivy/theming/light/camera'
|
||||
WizardButton:
|
||||
id: next
|
||||
text: _('Next')
|
||||
|
|
|
@ -73,16 +73,15 @@ SendScreen:
|
|||
BoxLayout:
|
||||
size_hint: 1, None
|
||||
height: '48dp'
|
||||
Button:
|
||||
IconButton:
|
||||
id: qr
|
||||
text: _('QR Code')
|
||||
on_release:
|
||||
app.scan_qr(on_complete=app.set_URI)
|
||||
size_hint: 0.5, 1
|
||||
on_release: app.scan_qr(on_complete=app.set_URI)
|
||||
icon: 'atlas://gui/kivy/theming/light/camera'
|
||||
Button:
|
||||
id: paste_button
|
||||
text: _('Paste')
|
||||
on_release:
|
||||
s.parent.do_paste()
|
||||
on_release: s.parent.do_paste()
|
||||
Button:
|
||||
text: _('Clear')
|
||||
size_hint: 1, None
|
||||
|
|
Loading…
Reference in New Issue