kivy wizard: fix seed display
This commit is contained in:
@@ -137,6 +137,29 @@ Builder.load_string('''
|
|||||||
self.parent.new_word(self.text)
|
self.parent.new_word(self.text)
|
||||||
|
|
||||||
|
|
||||||
|
<SeedButton@Button>:
|
||||||
|
height: dp(100)
|
||||||
|
border: 4, 4, 4, 4
|
||||||
|
halign: 'justify'
|
||||||
|
valign: 'top'
|
||||||
|
font_size: '18dp'
|
||||||
|
text_size: self.width - dp(24), self.height - dp(12)
|
||||||
|
color: .1, .1, .1, 1
|
||||||
|
background_normal: 'atlas://gui/kivy/theming/light/white_bg_round_top'
|
||||||
|
background_down: self.background_normal
|
||||||
|
size_hint_y: None
|
||||||
|
|
||||||
|
|
||||||
|
<SeedLabel@Label>:
|
||||||
|
font_size: '12sp'
|
||||||
|
text_size: self.width, None
|
||||||
|
size_hint: 1, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
halign: 'justify'
|
||||||
|
valign: 'middle'
|
||||||
|
border: 4, 4, 4, 4
|
||||||
|
|
||||||
|
|
||||||
<RestoreSeedDialog>
|
<RestoreSeedDialog>
|
||||||
word: ''
|
word: ''
|
||||||
Label:
|
Label:
|
||||||
@@ -152,38 +175,17 @@ Builder.load_string('''
|
|||||||
spacing: '12dp'
|
spacing: '12dp'
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
height: self.minimum_height
|
height: self.minimum_height
|
||||||
Button:
|
SeedButton:
|
||||||
border: 4, 4, 4, 4
|
|
||||||
halign: 'justify'
|
|
||||||
valign: 'middle'
|
|
||||||
font_size: self.width/15
|
|
||||||
text_size: self.width - dp(24), self.height - dp(12)
|
|
||||||
color: .1, .1, .1, 1
|
|
||||||
background_normal: 'atlas://gui/kivy/theming/light/white_bg_round_top'
|
|
||||||
background_down: self.background_normal
|
|
||||||
id: text_input_seed
|
id: text_input_seed
|
||||||
size_hint_y: None
|
|
||||||
height: dp(100)
|
|
||||||
text: ''
|
text: ''
|
||||||
on_text: Clock.schedule_once(root.on_text)
|
on_text: Clock.schedule_once(root.on_text)
|
||||||
Label:
|
SeedLabel:
|
||||||
font_size: '12sp'
|
|
||||||
text_size: self.width, None
|
|
||||||
size_hint: 1, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
halign: 'justify'
|
|
||||||
valign: 'middle'
|
|
||||||
text: root.message
|
text: root.message
|
||||||
on_ref_press:
|
|
||||||
import webbrowser
|
|
||||||
webbrowser.open('https://electrum.org/faq.html#seed')
|
|
||||||
|
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
id: suggestions
|
id: suggestions
|
||||||
height: '35dp'
|
height: '35dp'
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
new_word: root.on_word
|
new_word: root.on_word
|
||||||
|
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
id: line1
|
id: line1
|
||||||
update_amount: root.update_text
|
update_amount: root.update_text
|
||||||
@@ -294,33 +296,20 @@ Builder.load_string('''
|
|||||||
text_size: self.width, None
|
text_size: self.width, None
|
||||||
height: self.texture_size[1]
|
height: self.texture_size[1]
|
||||||
text: "[b]PLEASE WRITE DOWN YOUR SEED PHRASE[/b]"
|
text: "[b]PLEASE WRITE DOWN YOUR SEED PHRASE[/b]"
|
||||||
|
|
||||||
GridLayout:
|
GridLayout:
|
||||||
id: grid
|
id: grid
|
||||||
cols: 1
|
cols: 1
|
||||||
pos_hint: {'center_y': .5}
|
pos_hint: {'center_y': .5}
|
||||||
size_hint_y: None
|
size_hint_y: None
|
||||||
height: dp(180)
|
height: self.minimum_height
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
Button:
|
spacing: '12dp'
|
||||||
border: 4, 4, 4, 4
|
SeedButton:
|
||||||
halign: 'justify'
|
|
||||||
valign: 'middle'
|
|
||||||
font_size: self.width/15
|
|
||||||
text_size: self.width - dp(24), self.height - dp(12)
|
|
||||||
color: .1, .1, .1, 1
|
|
||||||
background_normal: 'atlas://gui/kivy/theming/light/white_bg_round_top'
|
|
||||||
background_down: self.background_normal
|
|
||||||
text: root.seed_text
|
text: root.seed_text
|
||||||
Label:
|
SeedLabel:
|
||||||
rows: 1
|
|
||||||
size_hint: 1, .7
|
|
||||||
border: 4, 4, 4, 4
|
|
||||||
halign: 'justify'
|
|
||||||
valign: 'middle'
|
|
||||||
font_size: self.width/21
|
|
||||||
text: root.message
|
text: root.message
|
||||||
text_size: self.width - dp(24), self.height - dp(12)
|
Widget:
|
||||||
|
size_hint: 1, 1
|
||||||
GridLayout:
|
GridLayout:
|
||||||
rows: 1
|
rows: 1
|
||||||
spacing: '12dp'
|
spacing: '12dp'
|
||||||
@@ -408,9 +397,9 @@ class RestoreSeedDialog(WizardDialog):
|
|||||||
self.mnemonic = Mnemonic('en')
|
self.mnemonic = Mnemonic('en')
|
||||||
|
|
||||||
def on_text(self, dt):
|
def on_text(self, dt):
|
||||||
text = self.ids.text_input_seed.text
|
self.ids.next.disabled = not bool(self._test(self.get_seed_text()))
|
||||||
self.ids.next.disabled = not bool(self._test(text))
|
|
||||||
|
|
||||||
|
text = self.ids.text_input_seed.text
|
||||||
if not text:
|
if not text:
|
||||||
last_word = ''
|
last_word = ''
|
||||||
elif text[-1] == ' ':
|
elif text[-1] == ' ':
|
||||||
|
|||||||
Reference in New Issue
Block a user