15 changed files with 1429 additions and 564 deletions
|
Before Width: | Height: | Size: 475 KiB After Width: | Height: | Size: 468 KiB |
@ -1 +1 @@ |
|||||||
{"light-0.png": {"closebutton": [641, 591, 60, 43], "card_top": [901, 792, 32, 16], "tab_btn_disabled": [867, 483, 32, 32], "tab_btn_pressed": [901, 483, 32, 32], "bit_logo": [589, 728, 44, 51], "globe": [686, 267, 72, 72], "btn_send_nfc": [955, 793, 18, 15], "shadow_right": [975, 803, 32, 5], "logo_atom_dull": [773, 517, 64, 64], "create_act_text_active": [995, 638, 22, 10], "action_group_light": [431, 344, 33, 48], "tab": [390, 715, 64, 64], "logo": [296, 211, 128, 128], "qrcode": [2, 194, 145, 145], "close": [834, 810, 88, 88], "btn_create_act_disabled": [985, 911, 32, 32], "white_bg_round_top": [834, 788, 31, 20], "card_bottom": [867, 792, 32, 16], "confirmed": [839, 636, 64, 64], "overflow_btn_dn": [989, 520, 16, 10], "carousel_deselected": [760, 275, 64, 64], "network": [692, 467, 48, 48], "blue_bg_round_rb": [935, 495, 31, 20], "dropdown_background": [765, 599, 29, 35], "action_bar": [795, 479, 36, 36], "pen": [905, 517, 64, 64], "overflow_background": [796, 599, 29, 35], "arrow_back": [971, 650, 50, 50], "clock3": [641, 636, 64, 64], "contact": [971, 532, 49, 49], "star_big_inactive": [426, 211, 128, 128], "lightblue_bg_round_lb": [968, 495, 31, 20], "manualentry": [149, 205, 145, 134], "stepper_restore_password": [247, 464, 392, 117], "tab_disabled": [752, 233, 96, 32], "mail_icon": [522, 725, 65, 54], "tab_strip": [850, 233, 96, 32], "tab_btn": [833, 483, 32, 32], "btn_create_account": [948, 233, 64, 32], "btn_send_address": [935, 793, 18, 15], "add_contact": [742, 472, 51, 43], "gear": [2, 33, 105, 159], "wallets": [703, 594, 60, 40], "stepper_left": [247, 583, 392, 117], "nfc_stage_one": [324, 900, 489, 122], "nfc_clock": [2, 460, 243, 240], "btn_nfc": [752, 219, 13, 12], "textinput_active": [718, 784, 114, 114], "clock2": [958, 275, 64, 64], "nfc_phone": [556, 213, 128, 126], "clock4": [707, 636, 64, 64], "paste_icon": [945, 945, 75, 77], "shadow": [324, 715, 64, 64], "carousel_selected": [826, 275, 64, 64], "card": [686, 216, 64, 49], "unconfirmed": [456, 715, 64, 64], "info": [707, 517, 64, 64], "electrum_icon640": [2, 702, 320, 320], "action_button_group": [971, 520, 16, 10], "action_group_dark": [396, 344, 33, 48], "nfc": [839, 517, 64, 64], "contact_avatar": [641, 466, 49, 49], "clock1": [892, 275, 64, 64], "create_act_text": [971, 638, 22, 10], "icon_border": [641, 517, 64, 64], "stepper_full": [324, 781, 392, 117], "card_btn": [945, 911, 38, 32], "wallet": [635, 735, 49, 44], "important": [924, 810, 88, 88], "dialog": [1001, 495, 18, 20], "error": [815, 908, 128, 114], "stepper_restore_seed": [2, 341, 392, 117], "contact_overlay": [905, 636, 64, 64], "settings": [396, 394, 54, 64], "clock5": [773, 636, 64, 64]}} |
{"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]}} |
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 9.1 KiB |
@ -1,319 +0,0 @@ |
|||||||
# source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget |
|
||||||
|
|
||||||
import sys, os, re |
|
||||||
import traceback, platform |
|
||||||
from kivy.core.window import Keyboard |
|
||||||
from kivy.uix.textinput import TextInput |
|
||||||
from kivy.properties import StringProperty, ListProperty, DictProperty |
|
||||||
from kivy.clock import Clock |
|
||||||
|
|
||||||
from electrum import util |
|
||||||
|
|
||||||
|
|
||||||
if platform.system() == 'Windows': |
|
||||||
MONOSPACE_FONT = 'Lucida Console' |
|
||||||
elif platform.system() == 'Darwin': |
|
||||||
MONOSPACE_FONT = 'Monaco' |
|
||||||
else: |
|
||||||
MONOSPACE_FONT = 'monospace' |
|
||||||
|
|
||||||
|
|
||||||
class Console(TextInput): |
|
||||||
|
|
||||||
prompt = StringProperty('>> ') |
|
||||||
'''String representing the Prompt message''' |
|
||||||
|
|
||||||
startup_message = StringProperty('') |
|
||||||
'''Startup Message to be displayed in the Console if any''' |
|
||||||
|
|
||||||
history = ListProperty([]) |
|
||||||
'''History of the console''' |
|
||||||
|
|
||||||
namespace = DictProperty({}) |
|
||||||
'''Dict representing the current namespace of the console''' |
|
||||||
|
|
||||||
def __init__(self, **kwargs): |
|
||||||
super(Console, self).__init__(**kwargs) |
|
||||||
self.construct = [] |
|
||||||
self.showMessage(self.startup_message) |
|
||||||
self.updateNamespace({'run':self.run_script}) |
|
||||||
self.set_json(False) |
|
||||||
|
|
||||||
def set_json(self, b): |
|
||||||
self.is_json = b |
|
||||||
|
|
||||||
def run_script(self, filename): |
|
||||||
with open(filename) as f: |
|
||||||
script = f.read() |
|
||||||
result = eval(script, self.namespace, self.namespace) |
|
||||||
|
|
||||||
def updateNamespace(self, namespace): |
|
||||||
self.namespace.update(namespace) |
|
||||||
|
|
||||||
def showMessage(self, message): |
|
||||||
self.appendPlainText(message) |
|
||||||
self.newPrompt() |
|
||||||
|
|
||||||
def clear(self): |
|
||||||
self.setPlainText('') |
|
||||||
self.newPrompt() |
|
||||||
|
|
||||||
def newPrompt(self): |
|
||||||
if self.construct: |
|
||||||
prompt = '.' * len(self.prompt) |
|
||||||
else: |
|
||||||
prompt = self.prompt |
|
||||||
|
|
||||||
self.completions_pos = self.cursor_index() |
|
||||||
self.completions_visible = False |
|
||||||
|
|
||||||
self.appendPlainText(prompt) |
|
||||||
self.move_cursor_to('end') |
|
||||||
|
|
||||||
def getCommand(self): |
|
||||||
curr_line = self._lines[-1] |
|
||||||
curr_line = curr_line.rstrip() |
|
||||||
curr_line = curr_line[len(self.prompt):] |
|
||||||
return curr_line |
|
||||||
|
|
||||||
def setCommand(self, command): |
|
||||||
if self.getCommand() == command: |
|
||||||
return |
|
||||||
curr_line = self._lines[-1] |
|
||||||
last_pos = len(self.text) |
|
||||||
self.select_text(last_pos - len(curr_line) + len(self.prompt), last_pos) |
|
||||||
self.delete_selection() |
|
||||||
self.insert_text(command) |
|
||||||
|
|
||||||
def show_completions(self, completions): |
|
||||||
if self.completions_visible: |
|
||||||
self.hide_completions() |
|
||||||
|
|
||||||
self.move_cursor_to(self.completions_pos) |
|
||||||
|
|
||||||
completions = map(lambda x: x.split('.')[-1], completions) |
|
||||||
t = '\n' + ' '.join(completions) |
|
||||||
if len(t) > 500: |
|
||||||
t = t[:500] + '...' |
|
||||||
self.insert_text(t) |
|
||||||
self.completions_end = self.cursor_index() |
|
||||||
|
|
||||||
self.move_cursor_to('end') |
|
||||||
self.completions_visible = True |
|
||||||
|
|
||||||
|
|
||||||
def hide_completions(self): |
|
||||||
if not self.completions_visible: |
|
||||||
return |
|
||||||
self.move_cursor_to(self.completions_pos) |
|
||||||
l = self.completions_end - self.completions_pos |
|
||||||
for x in range(l): |
|
||||||
self.move_cursor_to('cursor_right') |
|
||||||
self.do_backspace() |
|
||||||
|
|
||||||
self.move_cursor_to('end') |
|
||||||
self.completions_visible = False |
|
||||||
|
|
||||||
def getConstruct(self, command): |
|
||||||
if self.construct: |
|
||||||
prev_command = self.construct[-1] |
|
||||||
self.construct.append(command) |
|
||||||
if not prev_command and not command: |
|
||||||
ret_val = '\n'.join(self.construct) |
|
||||||
self.construct = [] |
|
||||||
return ret_val |
|
||||||
else: |
|
||||||
return '' |
|
||||||
else: |
|
||||||
if command and command[-1] == (':'): |
|
||||||
self.construct.append(command) |
|
||||||
return '' |
|
||||||
else: |
|
||||||
return command |
|
||||||
|
|
||||||
def getHistory(self): |
|
||||||
return self.history |
|
||||||
|
|
||||||
def setHisory(self, history): |
|
||||||
self.history = history |
|
||||||
|
|
||||||
def addToHistory(self, command): |
|
||||||
if command and (not self.history or self.history[-1] != command): |
|
||||||
self.history.append(command) |
|
||||||
self.history_index = len(self.history) |
|
||||||
|
|
||||||
def getPrevHistoryEntry(self): |
|
||||||
if self.history: |
|
||||||
self.history_index = max(0, self.history_index - 1) |
|
||||||
return self.history[self.history_index] |
|
||||||
return '' |
|
||||||
|
|
||||||
def getNextHistoryEntry(self): |
|
||||||
if self.history: |
|
||||||
hist_len = len(self.history) |
|
||||||
self.history_index = min(hist_len, self.history_index + 1) |
|
||||||
if self.history_index < hist_len: |
|
||||||
return self.history[self.history_index] |
|
||||||
return '' |
|
||||||
|
|
||||||
def getCursorPosition(self): |
|
||||||
return self.cursor[0] - len(self.prompt) |
|
||||||
|
|
||||||
def setCursorPosition(self, position): |
|
||||||
self.cursor = (len(self.prompt) + position, self.cursor[1]) |
|
||||||
|
|
||||||
def register_command(self, c, func): |
|
||||||
methods = { c: func} |
|
||||||
self.updateNamespace(methods) |
|
||||||
|
|
||||||
|
|
||||||
def runCommand(self): |
|
||||||
command = self.getCommand() |
|
||||||
self.addToHistory(command) |
|
||||||
|
|
||||||
command = self.getConstruct(command) |
|
||||||
|
|
||||||
if command: |
|
||||||
tmp_stdout = sys.stdout |
|
||||||
|
|
||||||
class stdoutProxy(): |
|
||||||
def __init__(self, write_func): |
|
||||||
self.write_func = write_func |
|
||||||
self.skip = False |
|
||||||
|
|
||||||
def flush(self): |
|
||||||
pass |
|
||||||
|
|
||||||
def write(self, text): |
|
||||||
if not self.skip: |
|
||||||
stripped_text = text.rstrip('\n') |
|
||||||
self.write_func(stripped_text) |
|
||||||
self.skip = not self.skip |
|
||||||
|
|
||||||
if type(self.namespace.get(command)) == type(lambda:None): |
|
||||||
self.appendPlainText("'%s' is a function. Type '%s()' to use it in the Python console."%(command, command)) |
|
||||||
self.newPrompt() |
|
||||||
return |
|
||||||
|
|
||||||
sys.stdout = stdoutProxy(self.appendPlainText) |
|
||||||
try: |
|
||||||
try: |
|
||||||
result = eval(command, self.namespace, self.namespace) |
|
||||||
if result != None: |
|
||||||
if self.is_json: |
|
||||||
util.print_json(result) |
|
||||||
else: |
|
||||||
self.appendPlainText(repr(result)) |
|
||||||
except SyntaxError: |
|
||||||
exec command in self.namespace |
|
||||||
except SystemExit: |
|
||||||
pass |
|
||||||
except: |
|
||||||
traceback_lines = traceback.format_exc().split('\n') |
|
||||||
# Remove traceback mentioning this file, and a linebreak |
|
||||||
for i in (3,2,1,-1): |
|
||||||
traceback_lines.pop(i) |
|
||||||
self.appendPlainText('\n'.join(traceback_lines)) |
|
||||||
sys.stdout = tmp_stdout |
|
||||||
self.newPrompt() |
|
||||||
self.set_json(False) |
|
||||||
|
|
||||||
def _keyboard_on_key_down(self, window, keycode, text, modifiers): |
|
||||||
self._hide_cut_copy_paste() |
|
||||||
is_osx = sys.platform == 'darwin' |
|
||||||
# Keycodes on OSX: |
|
||||||
ctrl, cmd = 64, 1024 |
|
||||||
key, key_str = keycode |
|
||||||
|
|
||||||
if key == Keyboard.keycodes['tab']: |
|
||||||
self.completions() |
|
||||||
return |
|
||||||
|
|
||||||
self.hide_completions() |
|
||||||
|
|
||||||
if key == Keyboard.keycodes['enter']: |
|
||||||
self.runCommand() |
|
||||||
return |
|
||||||
if key == Keyboard.keycodes['home']: |
|
||||||
self.setCursorPosition(0) |
|
||||||
return |
|
||||||
if key == Keyboard.keycodes['pageup']: |
|
||||||
return |
|
||||||
elif key in (Keyboard.keycodes['left'], Keyboard.keycodes['backspace']): |
|
||||||
if self.getCursorPosition() == 0: |
|
||||||
return |
|
||||||
elif key == Keyboard.keycodes['up']: |
|
||||||
self.setCommand(self.getPrevHistoryEntry()) |
|
||||||
return |
|
||||||
elif key == Keyboard.keycodes['down']: |
|
||||||
self.setCommand(self.getNextHistoryEntry()) |
|
||||||
return |
|
||||||
elif key == Keyboard.keycodes['l'] and modifiers == ['ctrl']: |
|
||||||
self.clear() |
|
||||||
|
|
||||||
super(Console, self)._keyboard_on_key_down(window, keycode, text, modifiers) |
|
||||||
|
|
||||||
def completions(self): |
|
||||||
cmd = self.getCommand() |
|
||||||
lastword = re.split(' |\(|\)',cmd)[-1] |
|
||||||
beginning = cmd[0:-len(lastword)] |
|
||||||
|
|
||||||
path = lastword.split('.') |
|
||||||
ns = self.namespace.keys() |
|
||||||
|
|
||||||
if len(path) == 1: |
|
||||||
ns = ns |
|
||||||
prefix = '' |
|
||||||
else: |
|
||||||
obj = self.namespace.get(path[0]) |
|
||||||
prefix = path[0] + '.' |
|
||||||
ns = dir(obj) |
|
||||||
|
|
||||||
|
|
||||||
completions = [] |
|
||||||
for x in ns: |
|
||||||
if x[0] == '_':continue |
|
||||||
xx = prefix + x |
|
||||||
if xx.startswith(lastword): |
|
||||||
completions.append(xx) |
|
||||||
completions.sort() |
|
||||||
|
|
||||||
if not completions: |
|
||||||
self.hide_completions() |
|
||||||
elif len(completions) == 1: |
|
||||||
self.hide_completions() |
|
||||||
self.setCommand(beginning + completions[0]) |
|
||||||
else: |
|
||||||
# find common prefix |
|
||||||
p = os.path.commonprefix(completions) |
|
||||||
if len(p)>len(lastword): |
|
||||||
self.hide_completions() |
|
||||||
self.setCommand(beginning + p) |
|
||||||
else: |
|
||||||
self.show_completions(completions) |
|
||||||
|
|
||||||
# NEW |
|
||||||
def setPlainText(self, message): |
|
||||||
"""Equivalent to QT version""" |
|
||||||
self.text = message |
|
||||||
|
|
||||||
# NEW |
|
||||||
def appendPlainText(self, message): |
|
||||||
"""Equivalent to QT version""" |
|
||||||
if len(self.text) == 0: |
|
||||||
self.text = message |
|
||||||
else: |
|
||||||
if message: |
|
||||||
self.text += '\n' + message |
|
||||||
|
|
||||||
# NEW |
|
||||||
def move_cursor_to(self, pos): |
|
||||||
"""Aggregate all cursor moving functions""" |
|
||||||
if isinstance(pos, int): |
|
||||||
self.cursor = self.get_cursor_from_index(pos) |
|
||||||
elif pos in ('end', 'pgend', 'pageend'): |
|
||||||
def updt_cursor(*l): |
|
||||||
self.cursor = self.get_cursor_from_index(self.text) |
|
||||||
Clock.schedule_once(updt_cursor) |
|
||||||
else: # cursor_home, cursor_end, ... (see docs) |
|
||||||
self.do_cursor_movement(pos) |
|
||||||
@ -0,0 +1,93 @@ |
|||||||
|
<ContactImage@Widget>: |
||||||
|
source: 'atlas://gui/kivy/theming/light/contact_avatar' |
||||||
|
size_hint_x: None |
||||||
|
width: self.height |
||||||
|
canvas: |
||||||
|
Color: |
||||||
|
rgba: 1, 1, 1, 1 |
||||||
|
Ellipse: |
||||||
|
source: root.source |
||||||
|
size: self.width + dp(6), self.height + dp(6) |
||||||
|
pos: self.x - dp(3), self.y - dp(3) |
||||||
|
Ellipse: |
||||||
|
source: 'atlas://gui/kivy/theming/light/contact_overlay' |
||||||
|
size: self.width + dp(11), self.height + dp(11) |
||||||
|
pos: self.x - dp(5.5), self.y - dp(5.5) |
||||||
|
|
||||||
|
<ContactLabel@Label> |
||||||
|
color: .305, .309, .309, 1 |
||||||
|
text_size: self.size |
||||||
|
halign: 'left' |
||||||
|
valign: 'middle' |
||||||
|
|
||||||
|
<ContactSeperator@Widget> |
||||||
|
canvas.before: |
||||||
|
Color: |
||||||
|
rgba: .890, .890, .890, 1 |
||||||
|
Rectangle: |
||||||
|
size: self.size |
||||||
|
pos: self.x, self.y + dp(9) |
||||||
|
size_hint: None, None |
||||||
|
size: '1dp', '22dp' |
||||||
|
pos_hint_y: .5 |
||||||
|
|
||||||
|
<ContactTextInput@TextInput> |
||||||
|
background_normal: self.background_down |
||||||
|
background_down: 'atlas://gui/kivy/theming/light/tab_btn' |
||||||
|
size_hint_y: None |
||||||
|
height: '22dp' |
||||||
|
|
||||||
|
<ContactBitLogo@Image> |
||||||
|
source: 'atlas://gui/kivy/theming/light/bit_logo' |
||||||
|
size_hint_x: None |
||||||
|
width: '32dp' |
||||||
|
|
||||||
|
<ContactItem@BoxLayout> |
||||||
|
address: '' |
||||||
|
label: '' |
||||||
|
tx_amt: 0 |
||||||
|
size_hint_y: None |
||||||
|
height: '65dp' |
||||||
|
padding: dp(12) |
||||||
|
spacing: dp(5) |
||||||
|
canvas.before: |
||||||
|
#Color: |
||||||
|
# rgba: 1, 1, 1, 1 |
||||||
|
Rectangle: |
||||||
|
size: self.size |
||||||
|
pos: self.pos |
||||||
|
ContactImage: |
||||||
|
id: contact_image |
||||||
|
Widget: |
||||||
|
size_hint_x: None |
||||||
|
width: '9dp' |
||||||
|
ContactLabel: |
||||||
|
id: contact_address |
||||||
|
text: root.address |
||||||
|
ContactSeperator: |
||||||
|
ContactLabel: |
||||||
|
text: root.label |
||||||
|
#ContactBitLogo: |
||||||
|
|
||||||
|
ContactsScreen: |
||||||
|
name: 'contacts' |
||||||
|
on_activate: |
||||||
|
if not self.action_view:\ |
||||||
|
self.action_view = app.root.main_screen.ids.tabs.ids.screen_dashboard.action_view |
||||||
|
BoxLayout: |
||||||
|
orientation: 'vertical' |
||||||
|
spacing: '1dp' |
||||||
|
ContactTextInput: |
||||||
|
ScrollView: |
||||||
|
canvas.before: |
||||||
|
#Color: |
||||||
|
# rgba: .8901, .8901, .8901, 1 |
||||||
|
Rectangle: |
||||||
|
size: self.size |
||||||
|
pos: self.pos |
||||||
|
GridLayout: |
||||||
|
cols: 1 |
||||||
|
id: contact_container |
||||||
|
size_hint_y: None |
||||||
|
height: self.minimum_height |
||||||
|
spacing: '1dp' |
||||||
@ -0,0 +1,224 @@ |
|||||||
|
#:import _ electrum.i18n._ |
||||||
|
#:import Factory kivy.factory.Factory |
||||||
|
#:set font_light 'data/fonts/Roboto-Condensed.ttf' |
||||||
|
#:set btc_symbol unichr(171) |
||||||
|
#:set mbtc_symbol unichr(187) |
||||||
|
|
||||||
|
|
||||||
|
<Card@GridLayout> |
||||||
|
cols: 1 |
||||||
|
padding: '12dp' , '22dp', '12dp' , '12dp' |
||||||
|
spacing: '12dp' |
||||||
|
size_hint: 1, None |
||||||
|
height: max(100, self.minimum_height) |
||||||
|
canvas.before: |
||||||
|
Color: |
||||||
|
rgba: 1, 1, 1, 1 |
||||||
|
BorderImage: |
||||||
|
border: 18, 18, 18, 18 |
||||||
|
source: 'atlas://gui/kivy/theming/light/card' |
||||||
|
size: self.size |
||||||
|
pos: self.pos |
||||||
|
|
||||||
|
<CardLabel@Label> |
||||||
|
color: 0.45, 0.45, 0.45, 1 |
||||||
|
size_hint: 1, None |
||||||
|
text: '' |
||||||
|
text_size: self.width, None |
||||||
|
height: self.texture_size[1] |
||||||
|
halign: 'left' |
||||||
|
valign: 'top' |
||||||
|
|
||||||
|
<CardButton@Button> |
||||||
|
background_normal: 'atlas://gui/kivy/theming/light/card_btn' |
||||||
|
bold: True |
||||||
|
font_size: '10sp' |
||||||
|
color: 0.699, 0.699, 0.699, 1 |
||||||
|
size_hint: None, None |
||||||
|
size: self.texture_size[0] + dp(32), self.texture_size[1] + dp(7) |
||||||
|
|
||||||
|
|
||||||
|
<CardItem@ButtonBehavior+GridLayout> |
||||||
|
canvas.before: |
||||||
|
Color: |
||||||
|
rgba: 0.192, .498, 0.745, 1 if self.state == 'down' else 0 |
||||||
|
Rectangle |
||||||
|
size: self.size |
||||||
|
pos: self.x, self.y + dp(5) |
||||||
|
cols: 1 |
||||||
|
padding: '2dp', '2dp' |
||||||
|
spacing: '2dp' |
||||||
|
size_hint: 1, None |
||||||
|
height: self.minimum_height |
||||||
|
|
||||||
|
<RecentActivityItem@CardItem> |
||||||
|
icon: 'atlas://gui/kivy/theming/light/important' |
||||||
|
address:'no address set' |
||||||
|
amount: '+0.00' |
||||||
|
balance: 'xyz'# balance_after |
||||||
|
amount_color: '#DB3627' if float(self.amount) < 0 else '#2EA442' |
||||||
|
confirmations: 0 |
||||||
|
date: '0/0/0' |
||||||
|
quote_text: '.' |
||||||
|
|
||||||
|
spacing: '9dp' |
||||||
|
on_release: |
||||||
|
app.history_screen.show_tx_details(root) |
||||||
|
BoxLayout: |
||||||
|
size_hint: 1, None |
||||||
|
spacing: '8dp' |
||||||
|
height: '32dp' |
||||||
|
Image: |
||||||
|
id: icon |
||||||
|
source: root.icon |
||||||
|
size_hint: None, 1 |
||||||
|
width: self.height *.54 |
||||||
|
mipmap: True |
||||||
|
BoxLayout: |
||||||
|
orientation: 'vertical' |
||||||
|
Widget |
||||||
|
CardLabel: |
||||||
|
shorten: True |
||||||
|
text: root.address |
||||||
|
markup: False |
||||||
|
text_size: self.size |
||||||
|
CardLabel: |
||||||
|
color: .699, .699, .699, 1 |
||||||
|
text: root.date |
||||||
|
font_size: '12sp' |
||||||
|
Widget |
||||||
|
CardLabel: |
||||||
|
halign: 'right' |
||||||
|
font_size: '13sp' |
||||||
|
size_hint: None, 1 |
||||||
|
width: '90sp' |
||||||
|
markup: True |
||||||
|
font_name: font_light |
||||||
|
text: |
||||||
|
u'[color={amount_color}]{sign}{symbol}{amount}[/color]\n'\ |
||||||
|
u'[color=#B2B3B3][size=12sp]{qt}[/size]'\ |
||||||
|
u'[/color]'.format(amount_color=root.amount_color,\ |
||||||
|
amount=root.amount[1:], qt=root.quote_text, sign=root.amount[0],\ |
||||||
|
symbol=btc_symbol if app.base_unit == 'BTC' else mbtc_symbol) |
||||||
|
CardSeparator |
||||||
|
|
||||||
|
<CardRecentActivity@Card> |
||||||
|
BoxLayout: |
||||||
|
size_hint: 1, None |
||||||
|
height: lbl.height |
||||||
|
CardLabel: |
||||||
|
id: lbl |
||||||
|
text: _('RECENT ACTIVITY') |
||||||
|
CardButton: |
||||||
|
id: btn_see_all |
||||||
|
disabled: True if not self.opacity else False |
||||||
|
text: _('SEE ALL') |
||||||
|
font_size: '12sp' |
||||||
|
on_release: app.update_history_tab(see_all=True) |
||||||
|
GridLayout: |
||||||
|
id: content |
||||||
|
spacing: '7dp' |
||||||
|
cols: 1 |
||||||
|
size_hint: 1, None |
||||||
|
height: self.minimum_height |
||||||
|
CardSeparator |
||||||
|
|
||||||
|
<CardPaymentRequest@Card> |
||||||
|
CardLabel: |
||||||
|
text: _('PAYMENT REQUEST') |
||||||
|
CardSeparator: |
||||||
|
|
||||||
|
<CardStatusInfo@Card> |
||||||
|
padding: '12dp' , '12dp' |
||||||
|
status: app.status |
||||||
|
quote_text: '' |
||||||
|
unconfirmed: '' |
||||||
|
cols: 2 |
||||||
|
FloatLayout |
||||||
|
anchor_x: 'left' |
||||||
|
size_hint: 1, None |
||||||
|
height: '82dp' |
||||||
|
IconButton: |
||||||
|
mipmap: True |
||||||
|
pos_hint: {'x': 0, 'center_y': .45} |
||||||
|
color: .90, .90, .90, 1 |
||||||
|
source: 'atlas://gui/kivy/theming/light/qrcode' |
||||||
|
size_hint: None, .85 |
||||||
|
width: self.height |
||||||
|
on_release: |
||||||
|
dlg = Cache.get('electrum_widgets', 'WalletAddressesDialog') |
||||||
|
|
||||||
|
if not dlg:\ |
||||||
|
Factory.register('WalletAddressesDialog', module='electrum_gui.kivy.uix.dialogs.carousel_dialog');\ |
||||||
|
dlg = Factory.WalletAddressesDialog();\ |
||||||
|
Cache.append('electrum_widgets', 'WalletAddressesDialog', dlg) |
||||||
|
|
||||||
|
dlg.open() |
||||||
|
CardLabel: |
||||||
|
id: top_label |
||||||
|
halign: 'right' |
||||||
|
valign: 'top' |
||||||
|
bold: True |
||||||
|
pos_hint: {'top': 1, 'right': 1} |
||||||
|
font_name: font_light |
||||||
|
#balance_in_numbers: bool(ord(root.status[0]) not in range(ord('A'), ord('z'))) |
||||||
|
balance_in_numbers: True |
||||||
|
font_size: '50sp' if self.balance_in_numbers else '30sp' |
||||||
|
text_size: self.width, root.height/2 |
||||||
|
text: |
||||||
|
u'[color=#4E4F4F]{}{}[/color]'\ |
||||||
|
.format('' if not self.balance_in_numbers else\ |
||||||
|
(btc_symbol if app.base_unit == 'BTC' else mbtc_symbol), root.status) |
||||||
|
BoxLayout |
||||||
|
pos_hint: {'y': 0, 'right': 1} |
||||||
|
spacing: '5dp' |
||||||
|
CardLabel |
||||||
|
halign: 'right' |
||||||
|
markup: True |
||||||
|
font_size: '22dp' |
||||||
|
font_name: font_light |
||||||
|
text: u'[color=#c3c3c3]{}[/color]'.format(root.quote_text) |
||||||
|
IconButton |
||||||
|
color: .698, .698, .698, 1 |
||||||
|
source: 'atlas://gui/kivy/theming/light/gear' |
||||||
|
size_hint_y: None |
||||||
|
height: '28dp' |
||||||
|
opacity: .5 if self.state == 'down' else 1 |
||||||
|
on_release: |
||||||
|
dlg = Cache.get('electrum_widgets', 'CurrencySelectionDialog') |
||||||
|
|
||||||
|
if not dlg:\ |
||||||
|
Factory.register('SelectionDialog', module='electrum_gui.kivy.uix.dialogs');\ |
||||||
|
dlg = Factory.CurrencySelectionDialog();\ |
||||||
|
Cache.append('electrum_widgets', 'CurrencySelectionDialog', dlg) |
||||||
|
|
||||||
|
dlg.open() |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
HistoryScreen: |
||||||
|
name: 'history' |
||||||
|
content: content |
||||||
|
ScrollView: |
||||||
|
id: content |
||||||
|
do_scroll_x: False |
||||||
|
GridLayout |
||||||
|
id: grid |
||||||
|
cols: 1 #if root.width < root.height else 2 |
||||||
|
size_hint: 1, None |
||||||
|
height: self.minimum_height |
||||||
|
padding: '12dp' |
||||||
|
spacing: '12dp' |
||||||
|
#GridLayout: |
||||||
|
# cols: 1 |
||||||
|
# size_hint: 1, None |
||||||
|
# height: self.minimum_height |
||||||
|
# spacing: '12dp' |
||||||
|
# orientation: 'vertical' |
||||||
|
# CardStatusInfo: |
||||||
|
# id: status_card |
||||||
|
# CardPaymentRequest: |
||||||
|
# id: payment_card |
||||||
|
CardRecentActivity: |
||||||
|
id: recent_activity_card |
||||||
|
|
||||||
@ -0,0 +1,10 @@ |
|||||||
|
Popup: |
||||||
|
id: network |
||||||
|
title: _('Network') |
||||||
|
BoxLayout: |
||||||
|
|
||||||
|
Button: |
||||||
|
size_hint_y: None |
||||||
|
height: '48dp' |
||||||
|
text: 'close' |
||||||
|
on_release: network.dismiss() |
||||||
@ -0,0 +1,171 @@ |
|||||||
|
#:import _ electrum.i18n._ |
||||||
|
#:import Decimal decimal.Decimal |
||||||
|
#:set btc_symbol unichr(171) |
||||||
|
#:set mbtc_symbol unichr(187) |
||||||
|
#:set font_light 'data/fonts/Roboto-Condensed.ttf' |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ReceiveScreen: |
||||||
|
name: 'receive' |
||||||
|
mode: 'qr' |
||||||
|
on_mode: if args[1] == 'nfc': from electrum_gui.kivy.nfc_scanner import NFCScanner |
||||||
|
action_view: Factory.ReceiveActionView() |
||||||
|
|
||||||
|
#on_activate: |
||||||
|
# self.ids.toggle_qr.state = 'down' |
||||||
|
# first_address = app.wallet.addresses()[0] |
||||||
|
# qr.data = app.encode_uri(first_address, |
||||||
|
# amount=amount_e.text, |
||||||
|
# label=app.wallet.labels.get(first_address, first_address), |
||||||
|
# message='') if app.wallet and app.wallet.addresses() else '' |
||||||
|
#on_deactivate: |
||||||
|
# self.ids.amount_e.focus = False |
||||||
|
|
||||||
|
BoxLayout |
||||||
|
padding: '12dp', '12dp', '12dp', '12dp' |
||||||
|
spacing: '12dp' |
||||||
|
mode: 'qr' |
||||||
|
orientation: 'vertical' |
||||||
|
SendReceiveToggle |
||||||
|
SendToggle: |
||||||
|
id: toggle_qr |
||||||
|
text: 'QR' |
||||||
|
state: 'down' if root.mode == 'qr' else 'normal' |
||||||
|
source: 'atlas://gui/kivy/theming/light/qrcode' |
||||||
|
background_down: 'atlas://gui/kivy/theming/light/btn_send_address' |
||||||
|
on_release: |
||||||
|
if root.mode == 'qr': root.mode = 'nr' |
||||||
|
root.mode = 'qr' |
||||||
|
SendToggle: |
||||||
|
id: toggle_nfc |
||||||
|
text: 'NFC' |
||||||
|
state: 'down' if root.mode == 'nfc' else 'normal' |
||||||
|
source: 'atlas://gui/kivy/theming/light/nfc' |
||||||
|
background_down: 'atlas://gui/kivy/theming/light/btn_send_nfc' |
||||||
|
on_release: |
||||||
|
if root.mode == 'nfc': root.mode = 'nr' |
||||||
|
root.mode = 'nfc' |
||||||
|
GridLayout: |
||||||
|
id: grid |
||||||
|
cols: 1 |
||||||
|
#size_hint: 1, None |
||||||
|
#height: self.minimum_height |
||||||
|
SendReceiveCardTop |
||||||
|
height: '110dp' |
||||||
|
BoxLayout: |
||||||
|
size_hint: 1, None |
||||||
|
height: '42dp' |
||||||
|
rows: 1 |
||||||
|
Label: |
||||||
|
color: amount_e.foreground_color |
||||||
|
bold: True |
||||||
|
text_size: self.size |
||||||
|
valign: 'bottom' |
||||||
|
font_size: '22sp' |
||||||
|
text: |
||||||
|
u'[font={fnt}]{smbl}[/font]'.\ |
||||||
|
format(smbl=btc_symbol if app.base_unit == 'BTC' else mbtc_symbol, fnt=font_light) |
||||||
|
size_hint_x: .25 |
||||||
|
ELTextInput: |
||||||
|
id: amount_e |
||||||
|
input_type: 'number' |
||||||
|
multiline: False |
||||||
|
bold: True |
||||||
|
font_size: '50sp' |
||||||
|
foreground_color: .308, .308, .308, 1 |
||||||
|
background_normal: 'atlas://gui/kivy/theming/light/tab_btn' |
||||||
|
pos_hint: {'top': 1.5} |
||||||
|
size_hint: .7, None |
||||||
|
height: '67dp' |
||||||
|
hint_text: 'Amount' |
||||||
|
text: '0.0' |
||||||
|
CardSeparator |
||||||
|
BoxLayout: |
||||||
|
size_hint: 1, None |
||||||
|
height: '32dp' |
||||||
|
spacing: '5dp' |
||||||
|
Label: |
||||||
|
color: lbl_quote.color |
||||||
|
font_size: '12dp' |
||||||
|
text: 'Ask to scan the QR below' |
||||||
|
text_size: self.size |
||||||
|
halign: 'left' |
||||||
|
valign: 'middle' |
||||||
|
Label: |
||||||
|
id: lbl_quote |
||||||
|
font_size: '12dp' |
||||||
|
size_hint: .5, 1 |
||||||
|
color: .761, .761, .761, 1 |
||||||
|
text: u'= {}'.format(app.create_quote_text(Decimal(float(amount_e.text)), mode='symbol')) if amount_e.text else u'0' |
||||||
|
text_size: self.size |
||||||
|
halign: 'right' |
||||||
|
valign: 'middle' |
||||||
|
SendReceiveBlueBottom |
||||||
|
id: blue_bottom |
||||||
|
padding: '12dp', 0, '12dp', '12dp' |
||||||
|
AddressSelector: |
||||||
|
id: address_selection |
||||||
|
foreground_color: blue_bottom.foreground_color |
||||||
|
opacity: 1 if app.expert_mode else 0 |
||||||
|
size_hint: 1, None |
||||||
|
height: blue_bottom.item_height if app.expert_mode else 0 |
||||||
|
on_text: |
||||||
|
if not args[1].startswith('Select'):\ |
||||||
|
qr.data = app.encode_uri(args[1],\ |
||||||
|
amount=amount_e.text,\ |
||||||
|
label=app.wallet.labels.get(args[1], args[1]),\ |
||||||
|
message='') |
||||||
|
CardSeparator |
||||||
|
opacity: address_selection.opacity |
||||||
|
color: blue_bottom.foreground_color |
||||||
|
Widget: |
||||||
|
size_hint_y: None |
||||||
|
height: dp(10) |
||||||
|
FloatLayout |
||||||
|
id: bl |
||||||
|
QRCodeWidget: |
||||||
|
id: qr |
||||||
|
size_hint: None, 1 |
||||||
|
width: min(self.height, bl.width) |
||||||
|
pos_hint: {'center': (.5, .5)} |
||||||
|
on_touch_down: |
||||||
|
if self.collide_point(*args[1].pos):\ |
||||||
|
app.show_info_bubble(icon=self.ids.qrimage.texture, text='texture') |
||||||
|
Button: |
||||||
|
background_color: (1, 1, 1, 1) if self.disabled else ((.258, .80, .388, 1) if self.state == 'normal' else (.203, .490, .741, 1)) |
||||||
|
text: _('Goto next step') if app.wallet and app.wallet.seed else _('Create unsigned transaction') |
||||||
|
size_hint_y: None |
||||||
|
height: '38dp' |
||||||
|
#disabled: True if wallet_selection.opacity == 0 else False |
||||||
|
on_release: |
||||||
|
message = 'sending {} {} to {}'.format(\ |
||||||
|
app.base_unit, amount_e.text, payto_e.text) |
||||||
|
app.gui.main_gui.do_send(self, message=message) |
||||||
|
|
||||||
|
<ReceiveActionView@ActionView> |
||||||
|
WalletActionPrevious: |
||||||
|
id: action_previous |
||||||
|
width: '32dp' |
||||||
|
ActionButton: |
||||||
|
id: action_logo |
||||||
|
important: True |
||||||
|
size_hint: 1, 1 |
||||||
|
markup: True |
||||||
|
mipmap: True |
||||||
|
bold: True |
||||||
|
markup: True |
||||||
|
color: 1, 1, 1, 1 |
||||||
|
text: |
||||||
|
"[color=#777777][sub] [sup][size=9dp]{}[/size][/sup][/sub]{}[/color]"\ |
||||||
|
.format(app.base_unit, app.status) |
||||||
|
font_size: '22dp' |
||||||
|
minimum_width: '1dp' |
||||||
|
Butt_star: |
||||||
|
id: but_star |
||||||
|
on_release: |
||||||
|
if self.state == 'down':\ |
||||||
|
app.show_info_bubble(\ |
||||||
|
text='[b]Expert mode on[/b]\n you can now select your address',\ |
||||||
|
icon='atlas://gui/kivy/theming/light/star_big_inactive',\ |
||||||
|
duration=1, arrow_pos='', width='250dp') |
||||||
@ -0,0 +1,243 @@ |
|||||||
|
#:import _ electrum.i18n._ |
||||||
|
#:import Decimal decimal.Decimal |
||||||
|
|
||||||
|
#:import Factory kivy.factory.Factory |
||||||
|
#:set btc_symbol unichr(171) |
||||||
|
#:set mbtc_symbol unichr(187) |
||||||
|
#:set font_light 'data/fonts/Roboto-Condensed.ttf' |
||||||
|
|
||||||
|
<SendActionView@ActionView> |
||||||
|
foreground_color: (.466, .466, .466, 1) |
||||||
|
color_active: (0.235, .588, .89, 1) |
||||||
|
WalletActionPrevious: |
||||||
|
id: action_previous |
||||||
|
width: but_star.width |
||||||
|
ActionButton: |
||||||
|
id: action_logo |
||||||
|
important: True |
||||||
|
size_hint: 1, 1 |
||||||
|
markup: True |
||||||
|
mipmap: True |
||||||
|
bold: True |
||||||
|
markup: True |
||||||
|
color: 1, 1, 1, 1 |
||||||
|
text: |
||||||
|
"[color=#777777][sub] [sup][size=9dp]{}[/size][/sup][/sub]{}[/color]"\ |
||||||
|
.format(app.base_unit, app.status) |
||||||
|
font_size: '22dp' |
||||||
|
minimum_width: '1dp' |
||||||
|
Butt_star: |
||||||
|
id: but_star |
||||||
|
on_release: |
||||||
|
if self.state == 'down':\ |
||||||
|
app.show_info_bubble(\ |
||||||
|
text='[b]Expert mode on[/b]\n you can now select your address',\ |
||||||
|
icon='atlas://gui/kivy/theming/light/star_big_inactive',\ |
||||||
|
duration=1, arrow_pos='', width='250dp') |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<TextInputSendBlue@TextInput> |
||||||
|
padding: '5dp' |
||||||
|
size_hint: 1, None |
||||||
|
height: '27dp' |
||||||
|
pos_hint: {'center_y':.5} |
||||||
|
multiline: False |
||||||
|
hint_text_color: self.foreground_color |
||||||
|
foreground_color: .843, .914, .972, 1 |
||||||
|
background_color: 1, 1, 1, 1 |
||||||
|
background_normal: 'atlas://gui/kivy/theming/light/tab_btn' |
||||||
|
background_active: 'atlas://gui/kivy/theming/light/textinput_active' |
||||||
|
|
||||||
|
|
||||||
|
SendScreen: |
||||||
|
|
||||||
|
mode: 'address' |
||||||
|
name: 'send' |
||||||
|
action_view: Factory.SendActionView() |
||||||
|
#on_deactivate: |
||||||
|
# self.ids.amount_e.focus = False |
||||||
|
# self.ids.payto_e.focus = False |
||||||
|
# self.ids.message_e.focus = False |
||||||
|
BoxLayout |
||||||
|
padding: '12dp', '12dp', '12dp', '12dp' |
||||||
|
spacing: '12dp' |
||||||
|
orientation: 'vertical' |
||||||
|
mode: 'address' |
||||||
|
SendReceiveToggle: |
||||||
|
SendToggle: |
||||||
|
id: toggle_address |
||||||
|
text: 'ADDRESS' |
||||||
|
group: 'send_type' |
||||||
|
state: 'down' if root.mode == 'address' else 'normal' |
||||||
|
source: 'atlas://gui/kivy/theming/light/globe' |
||||||
|
background_down: 'atlas://gui/kivy/theming/light/btn_send_address' |
||||||
|
on_release: |
||||||
|
if root.mode == 'address': root.mode = 'fc' |
||||||
|
root.mode = 'address' |
||||||
|
SendToggle: |
||||||
|
id: toggle_nfc |
||||||
|
text: 'NFC' |
||||||
|
group: 'send_type' |
||||||
|
state: 'down' if root.mode == 'nfc' else 'normal' |
||||||
|
source: 'atlas://gui/kivy/theming/light/nfc' |
||||||
|
background_down: 'atlas://gui/kivy/theming/light/btn_send_nfc' |
||||||
|
on_release: |
||||||
|
if root.mode == 'nfc': root.mode = 'str' |
||||||
|
root.mode = 'nfc' |
||||||
|
GridLayout: |
||||||
|
id: grid |
||||||
|
cols: 1 |
||||||
|
size_hint: 1, None |
||||||
|
height: self.minimum_height |
||||||
|
SendReceiveCardTop |
||||||
|
id: card_address |
||||||
|
BoxLayout |
||||||
|
size_hint: 1, None |
||||||
|
height: '42dp' |
||||||
|
rows: 1 |
||||||
|
Label |
||||||
|
id: lbl_symbl |
||||||
|
bold: True |
||||||
|
color: amount_e.foreground_color |
||||||
|
text_size: self.size |
||||||
|
valign: 'bottom' |
||||||
|
halign: 'left' |
||||||
|
font_size: '22sp' |
||||||
|
text: |
||||||
|
u'[font={fnt}]{smbl}[/font]'.\ |
||||||
|
format(smbl=btc_symbol if app.base_unit == 'BTC' else mbtc_symbol, fnt=font_light) |
||||||
|
size_hint_x: .25 |
||||||
|
ELTextInput: |
||||||
|
id: amount_e |
||||||
|
input_type: 'number' |
||||||
|
multiline: False |
||||||
|
bold: True |
||||||
|
font_size: '50sp' |
||||||
|
foreground_color: .308, .308, .308, 1 |
||||||
|
background_normal: 'atlas://gui/kivy/theming/light/tab_btn' |
||||||
|
pos_hint: {'top': 1.5} |
||||||
|
size_hint: .7, None |
||||||
|
height: '67dp' |
||||||
|
hint_text: 'Amount' |
||||||
|
text: '0.0' |
||||||
|
on_text_validate: payto_e.focus = True |
||||||
|
CardSeparator |
||||||
|
BoxLayout: |
||||||
|
size_hint: 1, None |
||||||
|
height: '42dp' |
||||||
|
spacing: '5dp' |
||||||
|
Label: |
||||||
|
id: fee_e |
||||||
|
color: .761, .761, .761, 1 |
||||||
|
font_size: '12dp' |
||||||
|
amt: app.format_amount(app.wallet.fee_per_kb(app.gui_object.config)) if app.wallet else 0 |
||||||
|
text: |
||||||
|
u'[b]{sign}{symbl}{amt}[/b] of fee'.\ |
||||||
|
format(symbl=lbl_symbl.text,\ |
||||||
|
sign='+' if self.amt > 0 else '-', amt=self.amt) |
||||||
|
size_hint_x: None |
||||||
|
width: self.texture_size[0] |
||||||
|
halign: 'left' |
||||||
|
valign: 'middle' |
||||||
|
IconButton: |
||||||
|
color: 0.694, 0.694, 0.694, 1 |
||||||
|
source: 'atlas://gui/kivy/theming/light/gear' |
||||||
|
pos_hint: {'center_y': .5} |
||||||
|
size_hint: None, None |
||||||
|
size: '22dp', '22dp' |
||||||
|
on_release: |
||||||
|
dlg = Cache.get('electrum_widgets', 'TransactionFeeDialog') |
||||||
|
|
||||||
|
if not dlg:\ |
||||||
|
Factory.register('SelectionDialog', module='electrum_gui.kivy.uix.dialogs');\ |
||||||
|
dlg = Factory.TransactionFeeDialog();\ |
||||||
|
Cache.append('electrum_widgets', 'TransactionDialog', dlg) |
||||||
|
|
||||||
|
dlg.return_obj = fee_e |
||||||
|
dlg.open() |
||||||
|
Label: |
||||||
|
font_size: '12dp' |
||||||
|
color: fee_e.color |
||||||
|
text: u'= {}'.format(app.create_quote_text(Decimal(float(amount_e.text)), mode='symbol')) if amount_e.text else u'0' |
||||||
|
text_size: self.size |
||||||
|
halign: 'right' |
||||||
|
valign: 'middle' |
||||||
|
SendReceiveBlueBottom: |
||||||
|
id: blue_bottom |
||||||
|
size_hint: 1, None |
||||||
|
height: self.minimum_height |
||||||
|
BoxLayout |
||||||
|
size_hint: 1, None |
||||||
|
height: blue_bottom.item_height |
||||||
|
spacing: '5dp' |
||||||
|
Image: |
||||||
|
source: 'atlas://gui/kivy/theming/light/contact' |
||||||
|
size_hint: None, None |
||||||
|
size: '22dp', '22dp' |
||||||
|
pos_hint: {'center_y': .5} |
||||||
|
TextInputSendBlue: |
||||||
|
id: payto_e |
||||||
|
hint_text: "Enter Contact or adress" |
||||||
|
on_text_validate: |
||||||
|
Factory.Animation(opacity=1,\ |
||||||
|
height=blue_bottom.item_height)\ |
||||||
|
.start(message_selection) |
||||||
|
message_e.focus = True |
||||||
|
Widget: |
||||||
|
size_hint: None, None |
||||||
|
width: dp(2) |
||||||
|
height: qr.height |
||||||
|
pos_hint: {'center_y':.5} |
||||||
|
canvas.after: |
||||||
|
Rectangle: |
||||||
|
size: self.size |
||||||
|
pos: self.pos |
||||||
|
IconButton: |
||||||
|
id: qr |
||||||
|
source: 'atlas://gui/kivy/theming/light/qrcode' |
||||||
|
pos_hint: {'center_y': .5} |
||||||
|
size_hint: None, None |
||||||
|
size: '22dp', '22dp' |
||||||
|
on_release: app.scan_qr(on_complete=root.set_qr_data) |
||||||
|
CardSeparator |
||||||
|
opacity: message_selection.opacity |
||||||
|
color: blue_bottom.foreground_color |
||||||
|
BoxLayout: |
||||||
|
id: message_selection |
||||||
|
opacity: 1 if app.expert_mode else 0 |
||||||
|
size_hint: 1, None |
||||||
|
height: blue_bottom.item_height if app.expert_mode else 0 |
||||||
|
spacing: '5dp' |
||||||
|
Image: |
||||||
|
source: 'atlas://gui/kivy/theming/light/pen' |
||||||
|
size_hint: None, None |
||||||
|
size: '22dp', '22dp' |
||||||
|
pos_hint: {'center_y': .5} |
||||||
|
TextInputSendBlue: |
||||||
|
id: message_e |
||||||
|
hint_text: 'Enter description here' |
||||||
|
on_text_validate: |
||||||
|
anim = Factory.Animation(opacity=1, height=blue_bottom.item_height) |
||||||
|
anim.start(wallet_selection) |
||||||
|
#anim.start(address_selection) |
||||||
|
CardSeparator |
||||||
|
opacity: address_selection.opacity |
||||||
|
color: blue_bottom.foreground_color |
||||||
|
AddressSelector: |
||||||
|
id: address_selection |
||||||
|
foreground_color: blue_bottom.foreground_color |
||||||
|
opacity: 1 if app.expert_mode else 0 |
||||||
|
size_hint: 1, None |
||||||
|
height: blue_bottom.item_height if app.expert_mode else 0 |
||||||
|
Button: |
||||||
|
#background_color: (1, 1, 1, 1) if self.disabled else ((.258, .80, .388, 1) if self.state == 'normal' else (.203, .490, .741, 1)) |
||||||
|
text: _('Send') |
||||||
|
size_hint_y: None |
||||||
|
height: '38dp' |
||||||
|
disabled: False |
||||||
|
on_release: app.do_send() |
||||||
|
Widget |
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,27 @@ |
|||||||
|
Popup: |
||||||
|
id: settings |
||||||
|
title: _('Settings') |
||||||
|
BoxLayout: |
||||||
|
|
||||||
|
Button: |
||||||
|
size_hint_y: None |
||||||
|
height: '48dp' |
||||||
|
text: 'Button normal' |
||||||
|
|
||||||
|
Button: |
||||||
|
size_hint_y: None |
||||||
|
height: '48dp' |
||||||
|
text: 'Button down' |
||||||
|
state: 'down' |
||||||
|
|
||||||
|
Button: |
||||||
|
size_hint_y: None |
||||||
|
height: '48dp' |
||||||
|
text: 'Button disabled' |
||||||
|
disabled: True |
||||||
|
|
||||||
|
Button: |
||||||
|
size_hint_y: None |
||||||
|
height: '48dp' |
||||||
|
text: 'close' |
||||||
|
on_release: settings.dismiss() |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
|
||||||
|
|
||||||
|
<WalletSelector@BlueSpinner> |
||||||
|
icon: 'atlas://gui/kivy/theming/light/wallet' |
||||||
|
values: ('default Wallet',) |
||||||
|
text: _('Select your wallet') |
||||||
|
|
||||||
|
|
||||||
|
ElectrumScreen: |
||||||
|
|
||||||
|
WalletSelector: |
||||||
|
id: wallet_selection |
||||||
|
size_hint: 1, None |
||||||
|
height: blue_bottom.item_height if app.expert_mode else 0 |
||||||
Loading…
Reference in new issue