2014-02-17 23:12:57 -08:00
|
|
|
#:import Window kivy.core.window.Window
|
2015-10-06 00:59:29 -07:00
|
|
|
#:import Factory kivy.factory.Factory
|
|
|
|
#:import _ electrum.i18n._
|
2014-03-10 11:48:12 -07:00
|
|
|
|
2014-02-17 23:12:57 -08:00
|
|
|
# Custom Global Widgets
|
|
|
|
|
|
|
|
<VGridLayout@GridLayout>:
|
|
|
|
rows: 1
|
|
|
|
size_hint: 1, None
|
|
|
|
height: self.minimum_height
|
|
|
|
|
2015-10-06 00:59:29 -07:00
|
|
|
<LightOptions@SpinnerOption>
|
|
|
|
font_size: '14sp'
|
|
|
|
border: 4, 4, 4, 4
|
|
|
|
color: 0.439, 0.439, 0.439, .8
|
|
|
|
background_normal: 'atlas://gui/kivy/theming/light/action_button_group'
|
|
|
|
background_down: 'atlas://gui/kivy/theming/light/overflow_btn_dn'
|
|
|
|
size_hint_y: None
|
|
|
|
height: '48dp'
|
|
|
|
text_size: self.size[0] - dp(20), self.size[1]
|
|
|
|
halign: 'left'
|
|
|
|
valign: 'middle'
|
|
|
|
shorten: True
|
|
|
|
on_press:
|
|
|
|
ddn = self.parent.parent
|
|
|
|
Factory.Animation(opacity=0, d=.25).start(ddn)
|
|
|
|
|
|
|
|
<OppositeDropDown@DropDown>
|
|
|
|
#auto_width: False
|
|
|
|
size_hint: None, None
|
|
|
|
size: self.container.minimum_size if self.container else (0, 0)
|
|
|
|
on_container: if args[1]: self.container.padding = '4dp', '4dp', '4dp', '4dp'
|
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgba: 1, 1, 1, 1
|
|
|
|
BorderImage:
|
|
|
|
pos:self.pos
|
|
|
|
border: 20, 20, 20, 20
|
|
|
|
source: 'atlas://gui/kivy/theming/light/dropdown_background'
|
|
|
|
size: self.size
|
|
|
|
|
|
|
|
<OppositeSpinner@CSpinner>
|
|
|
|
dropdown_cls: Factory.OppositeDropDown
|
|
|
|
option_cls: Factory.LightOptions
|
|
|
|
border: 20, 20, 9, 9
|
|
|
|
background_normal: 'atlas://gui/kivy/theming/light/action_group_dark'
|
|
|
|
background_down: self.background_normal
|
|
|
|
values: ('Copy to clipboard', 'Send Payment')
|
|
|
|
size_hint: None, 1
|
|
|
|
width: '12dp'
|
|
|
|
on_release:
|
|
|
|
ddn = self._dropdown
|
|
|
|
ddn.opacity = 0
|
|
|
|
Factory.Animation(opacity=1, d=.25).start(ddn)
|
|
|
|
|
|
|
|
|
|
|
|
<BlueSpinner@BoxLayout>
|
|
|
|
foreground_color: 1, 1, 1, 1
|
|
|
|
spacing: '9dp'
|
|
|
|
text: ''
|
|
|
|
values: ('', )
|
|
|
|
icon: ''
|
|
|
|
Image:
|
|
|
|
source: root.icon
|
|
|
|
size_hint: None, None
|
|
|
|
size: '22dp', '22dp'
|
|
|
|
pos_hint: {'center_y': .5}
|
|
|
|
OppositeSpinner:
|
|
|
|
color: root.foreground_color
|
|
|
|
background_normal: 'atlas://gui/kivy/theming/light/action_group_light'
|
|
|
|
markup: False
|
|
|
|
shorten: True
|
|
|
|
font_size: '16dp'
|
|
|
|
size_hint: 1, .7
|
|
|
|
pos_hint: {'center_y': .5}
|
|
|
|
text: root.text
|
|
|
|
text_size: self.size
|
|
|
|
halign: 'left'
|
|
|
|
valign: 'middle'
|
|
|
|
on_text:
|
|
|
|
root.text = args[1]
|
|
|
|
values: root.values
|
|
|
|
|
|
|
|
|
2014-02-17 23:12:57 -08:00
|
|
|
<IconButton@ButtonBehavior+Image>
|
|
|
|
allow_stretch: True
|
|
|
|
size_hint_x: None
|
|
|
|
width: self.height
|
|
|
|
canvas:
|
|
|
|
BorderImage:
|
|
|
|
border: (10, 10, 10, 10)
|
|
|
|
source:
|
|
|
|
'atlas://gui/kivy/theming/light/' + ('tab_btn'\
|
|
|
|
if root.state == 'normal' else 'icon_border')
|
|
|
|
size: root.size
|
|
|
|
pos: root.pos
|
|
|
|
|
2014-06-04 17:42:29 -07:00
|
|
|
|
|
|
|
<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'
|
2014-02-17 23:12:57 -08:00
|
|
|
|
|
|
|
|
2014-06-04 17:42:29 -07:00
|
|
|
###########################
|
2015-10-06 00:59:29 -07:00
|
|
|
# Global Defaults
|
2014-06-04 17:42:29 -07:00
|
|
|
###########################
|
|
|
|
<TextInput>
|
|
|
|
on_focus: app._focused_widget = root
|
|
|
|
|
|
|
|
<Label>
|
|
|
|
markup: True
|
|
|
|
font_name: 'Roboto'
|
|
|
|
font_size: '16sp'
|
|
|
|
|
|
|
|
<ListItemButton>
|
|
|
|
font_size: '12sp'
|
|
|
|
|
|
|
|
#########################
|
|
|
|
# Dialogs
|
|
|
|
#########################
|
2014-02-17 23:12:57 -08:00
|
|
|
|
|
|
|
<InfoBubble>
|
|
|
|
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:
|
2014-06-04 17:42:29 -07:00
|
|
|
padding: '5dp' if root.fs else 0
|
2014-02-17 23:12:57 -08:00
|
|
|
Widget:
|
|
|
|
size_hint: None, 1
|
|
|
|
width: '4dp' if root.fs else '2dp'
|
|
|
|
Image:
|
|
|
|
id: img
|
|
|
|
source: root.icon
|
|
|
|
mipmap: True
|
|
|
|
size_hint: None, 1
|
|
|
|
width: (root.width - dp(20)) if root.fs else (0 if not root.icon else '32dp')
|
2014-02-20 23:50:27 -08:00
|
|
|
Widget:
|
2014-03-01 11:11:58 -08:00
|
|
|
size_hint_x: None
|
2014-02-20 23:50:27 -08:00
|
|
|
width: '5dp'
|
2014-02-17 23:12:57 -08:00
|
|
|
Label:
|
|
|
|
id: lbl
|
|
|
|
markup: True
|
|
|
|
font_size: '12sp'
|
|
|
|
text: root.message
|
|
|
|
text_size: self.width, None
|
2014-03-01 11:11:58 -08:00
|
|
|
valign: 'middle'
|
|
|
|
size_hint: 1, 1
|
2014-02-17 23:12:57 -08:00
|
|
|
width: 0 if root.fs else (root.width - img.width)
|
|
|
|
|
2015-10-06 00:59:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
<WalletActionPrevious@ActionPrevious>
|
|
|
|
app_icon: 'atlas://gui/kivy/theming/light/' + ('wallets' if app.ui_mode[0] != 't' else 'tab_btn')
|
|
|
|
with_previous: False
|
|
|
|
size_hint: None, 1
|
|
|
|
mipmap: True
|
|
|
|
on_release: app.root.children[0].toggle_drawer()
|
|
|
|
|
|
|
|
|
|
|
|
<SendReceiveBlueBottom@GridLayout>
|
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgba: .238, .585, .878, 1
|
|
|
|
BorderImage:
|
|
|
|
border: 9, 9, 9, 9
|
|
|
|
source: 'atlas://gui/kivy/theming/light/card_bottom'
|
|
|
|
size: self.size
|
|
|
|
pos: self.pos
|
|
|
|
|
|
|
|
item_height: dp(42)
|
|
|
|
foreground_color: .843, .914, .972, 1
|
|
|
|
cols: 1
|
|
|
|
padding: '12dp', 0
|
|
|
|
|
|
|
|
|
|
|
|
<CardSeparator@Widget>
|
|
|
|
size_hint: 1, None
|
|
|
|
height: dp(1)
|
|
|
|
color: .909, .909, .909, 1
|
|
|
|
canvas:
|
|
|
|
Color:
|
|
|
|
rgba: root.color if root.color else (0, 0, 0, 0)
|
|
|
|
Rectangle:
|
|
|
|
size: self.size
|
|
|
|
pos: self.pos
|
|
|
|
|
|
|
|
<AddressSelector@BlueSpinner>
|
|
|
|
icon: 'atlas://gui/kivy/theming/light/globe'
|
2015-10-14 04:03:13 -07:00
|
|
|
values: [] #app.wallet.addresses() if app.wallet else []
|
2015-10-06 00:59:29 -07:00
|
|
|
text: _("Select Your address")
|
|
|
|
|
2015-12-02 09:02:11 -08:00
|
|
|
<AmountButton@Button>:
|
|
|
|
background_color: .238, .585, .878, 0
|
|
|
|
halign: 'left'
|
2015-12-02 10:25:07 -08:00
|
|
|
text_size: (self.width-10, None)
|
2015-12-02 09:02:11 -08:00
|
|
|
size_hint: 0.5, None
|
|
|
|
default_text: 'Amount'
|
|
|
|
text: self.default_text
|
|
|
|
padding: '5dp', '5db'
|
|
|
|
height: '40dp'
|
|
|
|
text_color: self.foreground_color
|
|
|
|
foreground_color: 1, 0, 0, 1
|
|
|
|
|
|
|
|
|
2015-10-14 09:03:02 -07:00
|
|
|
<TextInputBlue@TextInput>
|
|
|
|
padding: '5dp'
|
|
|
|
size_hint: 1, None
|
|
|
|
height: '27dp'
|
|
|
|
pos_hint: {'center_y':.5}
|
|
|
|
multiline: False
|
|
|
|
hint_text_color: self.foreground_color
|
2015-12-02 09:02:11 -08:00
|
|
|
foreground_color: 1, 1, 1, 1
|
|
|
|
font_size: '16dp'
|
2015-10-14 09:03:02 -07:00
|
|
|
background_normal: 'atlas://gui/kivy/theming/light/tab_btn'
|
|
|
|
background_active: 'atlas://gui/kivy/theming/light/textinput_active'
|
|
|
|
|
2015-10-06 00:59:29 -07:00
|
|
|
|
2015-10-16 05:59:26 -07:00
|
|
|
<KButton@Button>:
|
|
|
|
size_hint: 1, None
|
|
|
|
height: '48dp'
|
2015-12-07 01:40:10 -08:00
|
|
|
on_release:
|
|
|
|
self.parent.update_text(self.parent, self.text)
|
2015-10-16 05:59:26 -07:00
|
|
|
|
2015-10-06 00:59:29 -07:00
|
|
|
|
2015-10-07 03:04:42 -07:00
|
|
|
<TabbedPanelStrip>:
|
|
|
|
on_parent:
|
|
|
|
if self.parent: self.parent.bar_width = 0
|
|
|
|
|
2015-10-06 00:59:29 -07:00
|
|
|
|
|
|
|
<TabbedCarousel>
|
|
|
|
carousel: carousel
|
|
|
|
do_default_tab: False
|
|
|
|
Carousel:
|
|
|
|
scroll_timeout: 190
|
|
|
|
anim_type: 'out_quart'
|
|
|
|
min_move: .05
|
|
|
|
anim_move_duration: .1
|
|
|
|
anim_cancel_duration: .54
|
|
|
|
scroll_distance: '10dp'
|
|
|
|
on_index: root.on_index(*args)
|
|
|
|
id: carousel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<CleanHeader@TabbedPanelHeader>
|
2015-12-06 04:34:28 -08:00
|
|
|
#border: 0, 0, 16, 0
|
2015-10-06 00:59:29 -07:00
|
|
|
border: 0, 0, 16, 0
|
|
|
|
markup: False
|
|
|
|
text_size: self.size
|
|
|
|
halign: 'center'
|
|
|
|
valign: 'middle'
|
|
|
|
bold: True
|
|
|
|
font_size: '12.5sp'
|
|
|
|
background_normal: 'atlas://gui/kivy/theming/light/tab_btn'
|
|
|
|
background_down: 'atlas://gui/kivy/theming/light/tab_btn_pressed'
|
|
|
|
#canvas.before:
|
|
|
|
# Color:
|
|
|
|
# rgba: .6, .6, .6, .7
|
|
|
|
# Rectangle:
|
|
|
|
# size: self.size
|
|
|
|
# pos: self.x + 1, self.y - 1
|
|
|
|
# texture: self.texture
|
|
|
|
|
|
|
|
|
|
|
|
<ColoredLabel@Label>:
|
|
|
|
font_size: '48sp'
|
|
|
|
color: (.6, .6, .6, 1)
|
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgb: (.9, .9, .9)
|
|
|
|
Rectangle:
|
|
|
|
pos: self.x + sp(2), self.y + sp(2)
|
|
|
|
size: self.width - sp(4), self.height - sp(4)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ScreenTabs@Screen>
|
|
|
|
TabbedCarousel:
|
|
|
|
id: panel
|
|
|
|
tab_height: '48dp'
|
2015-10-06 05:30:44 -07:00
|
|
|
#default_tab: send_tab
|
2015-10-06 00:59:29 -07:00
|
|
|
strip_border: 0, 0, 0, 0
|
|
|
|
HistoryScreen:
|
|
|
|
id: history_screen
|
|
|
|
tab: history_tab
|
|
|
|
SendScreen:
|
|
|
|
id: send_screen
|
|
|
|
tab: send_tab
|
|
|
|
ReceiveScreen:
|
|
|
|
id: receive_screen
|
|
|
|
tab: receive_tab
|
|
|
|
ContactsScreen:
|
|
|
|
id: contacts_screen
|
|
|
|
tab: contacts_tab
|
|
|
|
CleanHeader:
|
|
|
|
id: history_tab
|
|
|
|
text: _('History')
|
|
|
|
slide: 0
|
|
|
|
CleanHeader:
|
|
|
|
id: send_tab
|
|
|
|
text: _('Send')
|
|
|
|
slide: 1
|
|
|
|
CleanHeader:
|
|
|
|
id: receive_tab
|
|
|
|
text: _('Receive')
|
|
|
|
slide: 2
|
|
|
|
CleanHeader:
|
|
|
|
id: contacts_tab
|
|
|
|
text: _('Contacts')
|
|
|
|
slide: 3
|
|
|
|
|
2015-10-30 06:23:48 -07:00
|
|
|
<ActionOvrButton@ActionButton>
|
|
|
|
on_release:
|
|
|
|
if self.parent: self.parent.parent.dismiss()
|
2015-12-02 03:11:28 -08:00
|
|
|
app.popup_dialog(self.name)
|
2015-10-06 00:59:29 -07:00
|
|
|
|
|
|
|
BoxLayout:
|
|
|
|
|
|
|
|
orientation: 'vertical'
|
|
|
|
|
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgb: .6, .6, .6
|
|
|
|
Rectangle:
|
2014-06-04 17:42:29 -07:00
|
|
|
size: self.size
|
2015-10-06 00:59:29 -07:00
|
|
|
source: 'gui/kivy/data/background.png'
|
|
|
|
|
|
|
|
ActionBar:
|
|
|
|
|
|
|
|
ActionView:
|
|
|
|
id: av
|
2015-10-30 06:23:48 -07:00
|
|
|
ActionPrevious:
|
2015-10-06 00:59:29 -07:00
|
|
|
app_icon: 'atlas://gui/kivy/theming/light/logo'
|
2015-12-06 04:34:28 -08:00
|
|
|
app_icon_width: '100dp'
|
2015-10-06 00:59:29 -07:00
|
|
|
with_previous: False
|
2015-10-30 06:23:48 -07:00
|
|
|
size_hint_x: None
|
2015-10-06 00:59:29 -07:00
|
|
|
|
|
|
|
ActionButton:
|
|
|
|
id: action_status
|
|
|
|
important: True
|
|
|
|
size_hint: 1, 1
|
|
|
|
markup: True
|
|
|
|
mipmap: True
|
|
|
|
bold: True
|
|
|
|
markup: True
|
|
|
|
color: 1, 1, 1, 1
|
|
|
|
text:
|
|
|
|
"[color=#777777]{}[/color]"\
|
|
|
|
.format(app.status)
|
|
|
|
font_size: '22dp'
|
|
|
|
minimum_width: '1dp'
|
2015-12-06 01:25:02 -08:00
|
|
|
|
|
|
|
ActionButton:
|
|
|
|
id: context_button
|
|
|
|
text: app.context
|
|
|
|
width: 0
|
|
|
|
on_text:
|
|
|
|
self.width = 20 if self.text else 0
|
|
|
|
on_release: app.context_action()
|
2015-10-06 00:59:29 -07:00
|
|
|
|
|
|
|
ActionOverflow:
|
2015-10-07 02:05:50 -07:00
|
|
|
id: ao
|
2015-10-30 06:23:48 -07:00
|
|
|
ActionOvrButton:
|
2015-10-06 00:59:29 -07:00
|
|
|
text: _('Network')
|
2015-12-02 03:11:28 -08:00
|
|
|
name: 'network'
|
2015-10-30 06:23:48 -07:00
|
|
|
on_parent:
|
|
|
|
# when widget overflow drop down is shown, adjust the width
|
|
|
|
parent = args[1]
|
|
|
|
if parent: ao._dropdown.width = sp(200)
|
|
|
|
ActionOvrButton:
|
2015-12-02 03:11:28 -08:00
|
|
|
name: 'settings'
|
2015-10-13 03:12:49 -07:00
|
|
|
text: _('Settings')
|
2015-10-30 06:23:48 -07:00
|
|
|
ActionOvrButton:
|
2015-12-02 03:11:28 -08:00
|
|
|
name: 'wallets'
|
2015-10-13 03:12:49 -07:00
|
|
|
text: _('Wallets')
|
2015-10-30 06:23:48 -07:00
|
|
|
ActionOvrButton:
|
2015-12-02 03:11:28 -08:00
|
|
|
name: 'plugins'
|
2015-10-13 03:12:49 -07:00
|
|
|
text: _('Plugins')
|
2015-10-30 06:23:48 -07:00
|
|
|
|
2015-10-06 00:59:29 -07:00
|
|
|
ScreenManager:
|
|
|
|
id: manager
|
|
|
|
ScreenTabs:
|
|
|
|
id: tabs
|