reorganize files and bring code inline with current master
Conflicts: lib/simple_config.py
This commit is contained in:
435
gui/kivy/main.kv
435
gui/kivy/main.kv
@@ -1,7 +1,4 @@
|
||||
#:import Window kivy.core.window.Window
|
||||
#:import _ electrum.i18n._
|
||||
#:import partial functools.partial
|
||||
|
||||
|
||||
# Custom Global Widgets
|
||||
|
||||
@@ -22,37 +19,36 @@
|
||||
if root.state == 'normal' else 'icon_border')
|
||||
size: root.size
|
||||
pos: root.pos
|
||||
###########################
|
||||
## Gloabal Defaults
|
||||
###########################
|
||||
|
||||
<Label>
|
||||
markup: True
|
||||
font_name: 'Roboto'
|
||||
font_size: '16sp'
|
||||
<Butt_star@ActionToggleButton>:
|
||||
important: True
|
||||
size_hint_x: None
|
||||
width: '32dp'
|
||||
mipmap: True
|
||||
state: 'down' if app.expert_mode else 'normal'
|
||||
background_down: self.background_normal
|
||||
foreground_color: (.466, .466, .466, 1)
|
||||
color_active: (0.235, .588, .89, 1)
|
||||
on_release: app.expert_mode = True if self.state == 'down' else False
|
||||
Image:
|
||||
source: 'atlas://gui/kivy/theming/light/star_big_inactive'
|
||||
center: root.center
|
||||
size: root.width/1.5, self.width
|
||||
color:
|
||||
root.foreground_color if root.state == 'normal' else root.color_active
|
||||
canvas.after:
|
||||
Color:
|
||||
rgba: 1, 1, 1, 1
|
||||
source:
|
||||
allow_stretch: True
|
||||
|
||||
<ListItemButton>
|
||||
font_size: '12sp'
|
||||
<ELTextInput>
|
||||
padding: '10dp', '4dp'
|
||||
background_color: (0.238, 0.589, .996, 1) if self.focus else self.foreground_color
|
||||
foreground_color: 0.531, 0.531, 0.531, 1
|
||||
background_active: 'atlas://gui/kivy/theming/light/textinput_active'
|
||||
background_normal: 'atlas://gui/kivy/theming/light/textinput_active'
|
||||
|
||||
#########################
|
||||
# Dialogs
|
||||
#########################
|
||||
|
||||
################################################
|
||||
## Create Dialogs
|
||||
################################################
|
||||
|
||||
<CreateAccountTextInput@TextInput>
|
||||
border: 4, 4, 4, 4
|
||||
font_size: '15sp'
|
||||
padding: '15dp', '15dp'
|
||||
background_color: (1, 1, 1, 1) if self.focus else (0.454, 0.698, 0.909, 1)
|
||||
foreground_color: (0.31, 0.31, 0.31, 1) if self.focus else (0.835, 0.909, 0.972, 1)
|
||||
hint_text_color: self.foreground_color
|
||||
background_active: 'atlas://gui/kivy/theming/light/create_act_text_active'
|
||||
background_normal: 'atlas://gui/kivy/theming/light/create_act_text_active'
|
||||
size_hint_y: None
|
||||
height: '48sp'
|
||||
|
||||
<CreateAccountButtonBlue@Button>
|
||||
canvas.after:
|
||||
@@ -75,26 +71,40 @@
|
||||
text_size: self.size
|
||||
halign: 'center'
|
||||
valign: 'middle'
|
||||
root: None
|
||||
background_normal: 'atlas://gui/kivy/theming/light/btn_create_account'
|
||||
background_down: 'atlas://gui/kivy/theming/light/btn_create_account'
|
||||
background_disabled_normal: 'atlas://gui/kivy/theming/light/btn_create_act_disabled'
|
||||
on_release: self.root.dispatch('on_press', self)
|
||||
on_release: self.root.dispatch('on_release', self)
|
||||
on_press: if self.root: self.root.dispatch('on_press', self)
|
||||
on_release: if self.root: self.root.dispatch('on_release', self)
|
||||
|
||||
|
||||
<CreateAccountButtonGreen@CreateAccountButtonBlue>
|
||||
background_color: (1, 1, 1, 1) if self.disabled else (.415, .717, 0, 1 if self.state == 'normal' else .75)
|
||||
###########################
|
||||
## Gloabal Defaults
|
||||
###########################
|
||||
<TextInput>
|
||||
on_focus: app._focused_widget = root
|
||||
|
||||
<Label>
|
||||
markup: True
|
||||
font_name: 'Roboto'
|
||||
font_size: '16sp'
|
||||
|
||||
<ListItemButton>
|
||||
font_size: '12sp'
|
||||
|
||||
#########################
|
||||
# Dialogs
|
||||
#########################
|
||||
|
||||
<InfoBubble>
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0, 0, 0, .7 if root.dim_background else 0
|
||||
Rectangle:
|
||||
size: Window.size
|
||||
size_hint: None, None
|
||||
width: '270dp' if root.fs else min(self.width, dp(270))
|
||||
height: self.width if self.fs else (lbl.texture_size[1] + dp(27))
|
||||
BoxLayout:
|
||||
padding: '5dp'
|
||||
padding: '5dp' if root.fs else 0
|
||||
Widget:
|
||||
size_hint: None, 1
|
||||
width: '4dp' if root.fs else '2dp'
|
||||
@@ -117,346 +127,11 @@
|
||||
size_hint: 1, 1
|
||||
width: 0 if root.fs else (root.width - img.width)
|
||||
|
||||
<-CreateAccountDialog>
|
||||
text_color: .854, .925, .984, 1
|
||||
auto_dismiss: False
|
||||
size_hint: None, None
|
||||
StencilView:
|
||||
manager: None
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 0, 0, 0, .9
|
||||
Rectangle:
|
||||
size: Window.size
|
||||
Color:
|
||||
rgba: .239, .588, .882, 1
|
||||
Rectangle:
|
||||
size: Window.size
|
||||
|
||||
crcontent: crcontent
|
||||
# add electrum icon
|
||||
FloatLayout:
|
||||
size_hint: None, None
|
||||
size: 0, 0
|
||||
IconButton:
|
||||
id: but_close
|
||||
size_hint: None, None
|
||||
size: '27dp', '27dp'
|
||||
top: Window.height - dp(10)
|
||||
right: Window.width - dp(10)
|
||||
source: 'atlas://gui/kivy/theming/light/closebutton'
|
||||
on_release: root.dispatch('on_press', self)
|
||||
on_release: root.dispatch('on_release', self)
|
||||
BoxLayout:
|
||||
orientation: 'vertical' if self.width < self.height else 'horizontal'
|
||||
padding:
|
||||
min(dp(42), self.width/8), min(dp(60), self.height/9.7),\
|
||||
min(dp(42), self.width/8), min(dp(72), self.height/8)
|
||||
spacing: '27dp'
|
||||
GridLayout:
|
||||
id: grid_logo
|
||||
cols: 1
|
||||
pos_hint: {'center_y': .5}
|
||||
size_hint: 1, .62
|
||||
#height: self.minimum_height
|
||||
Image:
|
||||
id: logo_img
|
||||
mipmap: True
|
||||
allow_stretch: True
|
||||
size_hint: 1, None
|
||||
height: '110dp'
|
||||
source: 'atlas://gui/kivy/theming/light/electrum_icon640'
|
||||
Widget:
|
||||
size_hint: 1, None
|
||||
height: 0 if stepper.opacity else dp(15)
|
||||
Label:
|
||||
color: root.text_color
|
||||
opacity: 0 if stepper.opacity else 1
|
||||
text: 'ELECTRUM'
|
||||
size_hint: 1, None
|
||||
height: self.texture_size[1] if self.opacity else 0
|
||||
font_size: '33sp'
|
||||
font_name: 'data/fonts/tron/Tr2n.ttf'
|
||||
Image:
|
||||
id: stepper
|
||||
allow_stretch: True
|
||||
opacity: 0
|
||||
source: 'atlas://gui/kivy/theming/light/stepper_left'
|
||||
size_hint: 1, None
|
||||
height: grid_logo.height/2.5 if self.opacity else 0
|
||||
Widget:
|
||||
size_hint: None, None
|
||||
size: '5dp', '5dp'
|
||||
GridLayout:
|
||||
cols: 1
|
||||
id: crcontent
|
||||
spacing: '13dp'
|
||||
|
||||
<CreateRestoreDialog>
|
||||
Label:
|
||||
color: root.text_color
|
||||
size_hint: 1, None
|
||||
text_size: self.width, None
|
||||
height: self.texture_size[1]
|
||||
text:
|
||||
_("Wallet file not found!!")+\
|
||||
"\n\n" + _("Do you want to create a new wallet ")+\
|
||||
_("or restore an existing one?")
|
||||
Widget
|
||||
size_hint: 1, None
|
||||
height: dp(15)
|
||||
GridLayout:
|
||||
id: grid
|
||||
orientation: 'vertical'
|
||||
cols: 1
|
||||
spacing: '14dp'
|
||||
size_hint: 1, None
|
||||
height: self.minimum_height
|
||||
CreateAccountButtonGreen:
|
||||
id: create
|
||||
text: _('Create a Wallet')
|
||||
root: root
|
||||
CreateAccountButtonBlue:
|
||||
id: restore
|
||||
text: _('I already have a wallet')
|
||||
root: root
|
||||
#CreateAccountButtonBlue:
|
||||
# id: watching
|
||||
# text: _('Create a Watching only wallet')
|
||||
# root: root
|
||||
|
||||
<RestoreSeedDialog>
|
||||
GridLayout
|
||||
# leave room for future selection of gap through a widget
|
||||
# removed for mobile
|
||||
id: text_input_gap
|
||||
text: '5'
|
||||
|
||||
cols: 1
|
||||
padding: 0, '12dp'
|
||||
orientation: 'vertical'
|
||||
spacing: '12dp'
|
||||
size_hint: 1, None
|
||||
height: self.minimum_height
|
||||
CreateAccountTextInput:
|
||||
id: text_input_seed
|
||||
size_hint: 1, None
|
||||
height: '110dp'
|
||||
hint_text:
|
||||
_('Enter your seedphrase')
|
||||
Label:
|
||||
font_size: '12sp'
|
||||
text_size: self.width, None
|
||||
size_hint: 1, None
|
||||
height: self.texture_size[1]
|
||||
halign: 'justify'
|
||||
valign: 'middle'
|
||||
text:
|
||||
_('If you need additional information, please check '
|
||||
'[color=#0000ff][ref=1]'
|
||||
'https://electrum.org/faq.html#seed[/ref][/color]')
|
||||
on_ref_press:
|
||||
import webbrowser
|
||||
webbrowser.open('https://electrum.org/faq.html#seed')
|
||||
GridLayout:
|
||||
rows: 1
|
||||
spacing: '12dp'
|
||||
size_hint: 1, None
|
||||
height: self.minimum_height
|
||||
CreateAccountButtonBlue:
|
||||
id: back
|
||||
text: _('Back')
|
||||
root: root
|
||||
CreateAccountButtonGreen:
|
||||
id: next
|
||||
text: _('Next')
|
||||
root: root
|
||||
|
||||
<InitSeedDialog>
|
||||
spacing: '12dp'
|
||||
GridLayout:
|
||||
id: grid
|
||||
cols: 1
|
||||
pos_hint: {'center_y': .5}
|
||||
size_hint_y: None
|
||||
height: dp(180)
|
||||
orientation: 'vertical'
|
||||
Button:
|
||||
border: 4, 4, 4, 4
|
||||
halign: 'justify'
|
||||
valign: 'middle'
|
||||
font_size: self.width/21
|
||||
text_size: self.width - dp(24), self.height - dp(12)
|
||||
#size_hint: 1, None
|
||||
#height: self.texture_size[1] + dp(24)
|
||||
background_normal: 'atlas://gui/kivy/theming/light/white_bg_round_top'
|
||||
background_down: self.background_normal
|
||||
text: root.message
|
||||
GridLayout:
|
||||
rows: 1
|
||||
size_hint: 1, .7
|
||||
#size_hint_y: None
|
||||
#height: but_seed.texture_size[1] + dp(24)
|
||||
Button:
|
||||
id: but_seed
|
||||
border: 4, 4, 4, 4
|
||||
halign: 'justify'
|
||||
valign: 'middle'
|
||||
font_size: self.width/15
|
||||
text: root.seed_msg
|
||||
text_size: self.width - dp(24), self.height - dp(12)
|
||||
background_normal: 'atlas://gui/kivy/theming/light/lightblue_bg_round_lb'
|
||||
background_down: self.background_normal
|
||||
Button:
|
||||
id: bt
|
||||
size_hint_x: .25
|
||||
background_normal: 'atlas://gui/kivy/theming/light/blue_bg_round_rb'
|
||||
background_down: self.background_normal
|
||||
Image:
|
||||
mipmap: True
|
||||
source: 'atlas://gui/kivy/theming/light/qrcode'
|
||||
size: bt.size
|
||||
center: bt.center
|
||||
#on_release:
|
||||
GridLayout:
|
||||
rows: 1
|
||||
spacing: '12dp'
|
||||
size_hint: 1, None
|
||||
height: self.minimum_height
|
||||
CreateAccountButtonBlue:
|
||||
id: back
|
||||
text: _('Back')
|
||||
root: root
|
||||
CreateAccountButtonGreen:
|
||||
id: confirm
|
||||
text: _('Confirm')
|
||||
root: root
|
||||
|
||||
<ChangePasswordDialog>
|
||||
padding: '7dp'
|
||||
GridLayout:
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
cols: 1
|
||||
CreateAccountTextInput:
|
||||
id: ti_wallet_name
|
||||
hint_text: 'Your Wallet Name'
|
||||
multiline: False
|
||||
on_text_validate:
|
||||
next = ti_new_password if ti_password.disabled else ti_password
|
||||
next.focus = True
|
||||
Widget:
|
||||
size_hint_y: None
|
||||
height: '13dp'
|
||||
CreateAccountTextInput:
|
||||
id: ti_password
|
||||
hint_text: 'Enter old pincode'
|
||||
size_hint_y: None
|
||||
height: 0 if self.disabled else '38sp'
|
||||
password: True
|
||||
disabled: True if root.mode in ('new', 'create', 'restore') else False
|
||||
opacity: 0 if self.disabled else 1
|
||||
multiline: False
|
||||
on_text_validate:
|
||||
#root.validate_old_password()
|
||||
ti_new_password.focus = True
|
||||
Widget:
|
||||
size_hint_y: None
|
||||
height: 0 if ti_password.disabled else '13dp'
|
||||
CreateAccountTextInput:
|
||||
id: ti_new_password
|
||||
hint_text: 'Enter new pincode'
|
||||
multiline: False
|
||||
password: True
|
||||
on_text_validate: ti_confirm_password.focus = True
|
||||
Widget:
|
||||
size_hint_y: None
|
||||
height: '13dp'
|
||||
CreateAccountTextInput:
|
||||
id: ti_confirm_password
|
||||
hint_text: 'Confirm pincode'
|
||||
password: True
|
||||
multiline: False
|
||||
on_text_validate: root.validate_new_password()
|
||||
Widget
|
||||
GridLayout:
|
||||
rows: 1
|
||||
spacing: '12dp'
|
||||
size_hint: 1, None
|
||||
height: self.minimum_height
|
||||
CreateAccountButtonBlue:
|
||||
id: back
|
||||
text: _('Back')
|
||||
root: root
|
||||
disabled: True if root.mode[0] == 'r' else self.disabled
|
||||
CreateAccountButtonGreen:
|
||||
id: next
|
||||
text: _('Confirm') if root.mode[0] == 'r' else _('Next')
|
||||
root: root
|
||||
|
||||
###############################################
|
||||
## Wallet Management
|
||||
###############################################
|
||||
|
||||
<WalletManagement@ScrollView>
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: .145, .145, .145, 1
|
||||
Rectangle:
|
||||
size: root.size
|
||||
pos: root.pos
|
||||
VGridLayout:
|
||||
Wallets:
|
||||
id: wallets_section
|
||||
Plugins:
|
||||
id: plugins_section
|
||||
Commands:
|
||||
id: commands_section
|
||||
|
||||
<WalletManagementItem@BoxLayout>
|
||||
|
||||
<Header@WalletManagementItem>
|
||||
|
||||
<Wallets@VGridLayout>
|
||||
Header
|
||||
|
||||
<Plugins@VGridLayout>
|
||||
Header
|
||||
|
||||
<Commands@VGridLayout>
|
||||
Header
|
||||
|
||||
################################################
|
||||
## This is our Root Widget of the app
|
||||
################################################
|
||||
StencilView
|
||||
manager: manager
|
||||
Drawer
|
||||
id: drawer
|
||||
size: root.size
|
||||
WalletManagement
|
||||
id: wallet_management
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: .176, .176, .176, 1
|
||||
Rectangle:
|
||||
size: self.size
|
||||
pos: self.pos
|
||||
width:
|
||||
(root.width * .877) if app.ui_mode[0] == 'p'\
|
||||
else root.width * .35 if app.orientation[0] == 'l'\
|
||||
else root.width * .10
|
||||
height: root.height
|
||||
BoxLayout:
|
||||
x: wallet_management.width if app.ui_mode[0] == 't' else 0
|
||||
width: (root.width - self.x) if app.ui_mode[0] == 't' else root.width
|
||||
size_hint: None, None
|
||||
height: root.height
|
||||
canvas.before:
|
||||
Color
|
||||
rgba: 1, 1, 1, 1
|
||||
BorderImage
|
||||
border: 0, 32, 0, 0
|
||||
source: 'atlas://gui/kivy/theming/light/shadow_right'
|
||||
pos: root.pos
|
||||
size: self.x, self.height
|
||||
ScreenManager:
|
||||
id: manager
|
||||
rgba: 1, 1, 1, 1
|
||||
Rectangle
|
||||
size: self.size
|
||||
pos: self.pos
|
||||
Reference in New Issue
Block a user