2015-12-16 03:40:30 -08:00
|
|
|
#:import Clock kivy.clock.Clock
|
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
|
2016-02-04 01:49:51 -08:00
|
|
|
#:import _ electrum_gui.kivy.i18n._
|
2014-03-10 11:48:12 -07:00
|
|
|
|
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
|
|
|
###########################
|
|
|
|
|
|
|
|
<Label>
|
|
|
|
markup: True
|
|
|
|
font_name: 'Roboto'
|
|
|
|
font_size: '16sp'
|
2016-02-04 04:48:40 -08:00
|
|
|
bound: False
|
2016-02-04 11:14:11 -08:00
|
|
|
on_text: if isinstance(self.text, _) and not self.bound: self.bound=True; _.bind(self)
|
2014-06-04 17:42:29 -07:00
|
|
|
|
2016-02-04 02:05:40 -08:00
|
|
|
<TextInput>
|
|
|
|
on_focus: app._focused_widget = root
|
|
|
|
|
|
|
|
<Button>
|
|
|
|
on_parent: self.MIN_STATE_TIME = 0.1
|
|
|
|
|
2014-06-04 17:42:29 -07:00
|
|
|
<ListItemButton>
|
|
|
|
font_size: '12sp'
|
|
|
|
|
2016-02-16 05:17:44 -08:00
|
|
|
<Carousel>:
|
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgba: 0.1, 0.1, 0.1, 1
|
|
|
|
Rectangle:
|
|
|
|
size: self.size
|
|
|
|
pos: self.pos
|
|
|
|
|
|
|
|
<ActionView>:
|
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgba: 0.1, 0.1, 0.1, 1
|
|
|
|
Rectangle:
|
|
|
|
size: self.size
|
|
|
|
pos: self.pos
|
|
|
|
|
|
|
|
|
2016-02-04 02:05:40 -08:00
|
|
|
# Custom Global Widgets
|
|
|
|
|
2016-02-16 01:24:13 -08:00
|
|
|
<TopLabel@Label>
|
|
|
|
size_hint_y: None
|
|
|
|
text_size: self.width, None
|
|
|
|
height: self.texture_size[1]
|
|
|
|
|
2016-02-04 02:05:40 -08:00
|
|
|
<EmptyLabel@Label>
|
|
|
|
color: (0.8, 0.8, 0.8, 1)
|
|
|
|
size_hint_y: None
|
|
|
|
text_size: self.width, None
|
|
|
|
height: self.texture_size[1]
|
|
|
|
|
|
|
|
<VGridLayout@GridLayout>:
|
|
|
|
rows: 1
|
|
|
|
size_hint: 1, None
|
|
|
|
height: self.minimum_height
|
|
|
|
|
2016-02-08 02:06:45 -08:00
|
|
|
|
|
|
|
|
|
|
|
<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'
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-06-04 17:42:29 -07:00
|
|
|
#########################
|
|
|
|
# Dialogs
|
|
|
|
#########################
|
2016-02-17 20:35:01 -08:00
|
|
|
<BoxLabel@BoxLayout>
|
|
|
|
text: ''
|
|
|
|
value: ''
|
|
|
|
size_hint_y: None
|
|
|
|
height: max(lbl1.height, lbl2.height)
|
|
|
|
TopLabel
|
|
|
|
id: lbl1
|
|
|
|
text: root.text
|
2016-02-17 21:58:46 -08:00
|
|
|
pos_hint: {'top':1}
|
2016-02-17 20:35:01 -08:00
|
|
|
TopLabel
|
|
|
|
id: lbl2
|
|
|
|
text: root.value
|
2014-02-17 23:12:57 -08:00
|
|
|
|
2016-02-17 02:40:05 -08:00
|
|
|
<OutputList>
|
|
|
|
height: self.minimum_height
|
2016-02-17 06:19:09 -08:00
|
|
|
size_hint_y: None
|
2016-02-17 02:40:05 -08:00
|
|
|
cols: 2
|
|
|
|
spacing: '10dp'
|
|
|
|
padding: '10dp'
|
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgb: .3, .3, .3
|
|
|
|
Rectangle:
|
|
|
|
size: self.size
|
|
|
|
pos: self.pos
|
|
|
|
|
2016-02-17 09:04:34 -08:00
|
|
|
<TxHashLabel@TopLabel>
|
|
|
|
font_size: '6pt'
|
|
|
|
tx_hash: ''
|
|
|
|
text: '[ref=x]%s[/ref]' %' '.join(map(''.join, zip(*[iter(self.tx_hash)]*4))) if self.tx_hash else ''
|
|
|
|
padding: '10dp', '10dp'
|
|
|
|
on_ref_press:
|
|
|
|
app._clipboard.copy(self.text)
|
|
|
|
app.show_info(_('Transaction ID copied to clipboard'))
|
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgb: .3, .3, .3
|
|
|
|
Rectangle:
|
|
|
|
size: self.size
|
|
|
|
pos: self.pos
|
2016-02-17 02:40:05 -08:00
|
|
|
|
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
|
|
|
|
|
|
|
<SendReceiveBlueBottom@GridLayout>
|
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgba: .238, .585, .878, 1
|
|
|
|
BorderImage:
|
2016-02-05 12:07:48 -08:00
|
|
|
#border: 9, 9, 9, 9
|
2015-10-06 00:59:29 -07:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2016-02-14 20:00:14 -08:00
|
|
|
|
2015-10-06 00:59:29 -07:00
|
|
|
<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
|
|
|
|
|
2015-12-12 07:54:32 -08:00
|
|
|
<CardItem@ToggleButtonBehavior+BoxLayout>
|
|
|
|
size_hint: 1, None
|
|
|
|
height: '65dp'
|
|
|
|
group: 'requests'
|
|
|
|
padding: dp(12)
|
|
|
|
spacing: dp(5)
|
|
|
|
screen: None
|
|
|
|
on_release:
|
|
|
|
self.screen.show_menu(args[0]) if self.state == 'down' else self.screen.hide_menu()
|
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgba: (0.192, .498, 0.745, 1) if self.state == 'down' else (0.3, 0.3, 0.3, 1)
|
|
|
|
Rectangle:
|
|
|
|
size: self.size
|
|
|
|
pos: self.pos
|
|
|
|
|
2015-12-14 03:08:11 -08:00
|
|
|
<BlueButton@Button>:
|
2015-12-02 09:02:11 -08:00
|
|
|
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
|
2015-12-14 03:08:11 -08:00
|
|
|
default_text: ''
|
2015-12-02 09:02:11 -08:00
|
|
|
text: self.default_text
|
|
|
|
padding: '5dp', '5db'
|
|
|
|
height: '40dp'
|
|
|
|
text_color: self.foreground_color
|
|
|
|
foreground_color: 1, 0, 0, 1
|
2015-12-14 12:34:25 -08:00
|
|
|
canvas.before:
|
|
|
|
Color:
|
|
|
|
rgba: (0.9, .498, 0.745, 1) if self.state == 'down' else self.background_color
|
|
|
|
Rectangle:
|
|
|
|
size: self.size
|
|
|
|
pos: self.pos
|
2015-12-02 09:02:11 -08:00
|
|
|
|
|
|
|
|
2015-12-20 08:37:07 -08:00
|
|
|
<KButton@Button>:
|
|
|
|
size_hint: 1, None
|
|
|
|
height: '48dp'
|
|
|
|
on_release:
|
|
|
|
self.parent.update_amount(self.text)
|
|
|
|
|
|
|
|
|
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-12-13 08:36:23 -08:00
|
|
|
if self.parent: self.parent.scroll_x = 0.5
|
2015-10-07 03:04:42 -07:00
|
|
|
|
2015-10-06 00:59:29 -07:00
|
|
|
|
|
|
|
<TabbedCarousel>
|
|
|
|
carousel: carousel
|
|
|
|
do_default_tab: False
|
|
|
|
Carousel:
|
2015-12-14 12:34:25 -08:00
|
|
|
scroll_timeout: 250
|
|
|
|
scroll_distance: '20dp'
|
2015-10-06 00:59:29 -07:00
|
|
|
anim_type: 'out_quart'
|
|
|
|
min_move: .05
|
|
|
|
anim_move_duration: .1
|
|
|
|
anim_cancel_duration: .54
|
|
|
|
on_index: root.on_index(*args)
|
|
|
|
id: carousel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<CleanHeader@TabbedPanelHeader>
|
2016-02-16 05:17:44 -08:00
|
|
|
border: 16, 0, 16, 0
|
2015-10-06 00:59:29 -07:00
|
|
|
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'
|
|
|
|
|
|
|
|
|
|
|
|
<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-12-13 08:36:23 -08:00
|
|
|
tab_width: panel.width/3
|
2015-10-06 00:59:29 -07:00
|
|
|
strip_border: 0, 0, 0, 0
|
2015-12-11 06:32:48 -08:00
|
|
|
InvoicesScreen:
|
|
|
|
id: invoices_screen
|
|
|
|
tab: invoices_tab
|
2015-10-06 00:59:29 -07:00
|
|
|
SendScreen:
|
|
|
|
id: send_screen
|
|
|
|
tab: send_tab
|
2015-12-11 06:32:48 -08:00
|
|
|
HistoryScreen:
|
|
|
|
id: history_screen
|
|
|
|
tab: history_tab
|
2015-10-06 00:59:29 -07:00
|
|
|
ReceiveScreen:
|
|
|
|
id: receive_screen
|
|
|
|
tab: receive_tab
|
2015-12-10 02:33:58 -08:00
|
|
|
RequestsScreen:
|
|
|
|
id: requests_screen
|
|
|
|
tab: requests_tab
|
2015-10-06 00:59:29 -07:00
|
|
|
CleanHeader:
|
2015-12-11 06:32:48 -08:00
|
|
|
id: invoices_tab
|
|
|
|
text: _('Invoices')
|
2015-10-06 00:59:29 -07:00
|
|
|
slide: 0
|
|
|
|
CleanHeader:
|
|
|
|
id: send_tab
|
|
|
|
text: _('Send')
|
|
|
|
slide: 1
|
|
|
|
CleanHeader:
|
2015-12-11 06:32:48 -08:00
|
|
|
id: history_tab
|
|
|
|
text: _('History')
|
2015-10-06 00:59:29 -07:00
|
|
|
slide: 2
|
|
|
|
CleanHeader:
|
2015-12-11 06:32:48 -08:00
|
|
|
id: receive_tab
|
|
|
|
text: _('Receive')
|
2015-10-06 00:59:29 -07:00
|
|
|
slide: 3
|
2015-12-10 02:33:58 -08:00
|
|
|
CleanHeader:
|
|
|
|
id: requests_tab
|
|
|
|
text: _('Requests')
|
|
|
|
slide: 4
|
2016-02-14 20:00:14 -08:00
|
|
|
|
2015-10-06 00:59:29 -07:00
|
|
|
|
2015-10-30 06:23:48 -07:00
|
|
|
<ActionOvrButton@ActionButton>
|
|
|
|
on_release:
|
2015-12-16 03:40:30 -08:00
|
|
|
Clock.schedule_once(lambda dt: self.parent.parent.dismiss() if self.parent else None, 0.05)
|
|
|
|
Clock.schedule_once(lambda dt: app.popup_dialog(self.name), 0.05)
|
2015-12-07 05:33:18 -08:00
|
|
|
|
|
|
|
|
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
|
|
|
|
bold: True
|
2016-02-16 05:17:44 -08:00
|
|
|
color: 0.7, 0.7, 0.7, 1
|
|
|
|
text: app.status
|
2015-10-06 00:59:29 -07:00
|
|
|
font_size: '22dp'
|
|
|
|
minimum_width: '1dp'
|
2015-12-18 02:29:56 -08:00
|
|
|
on_release: app.popup_dialog('status')
|
2015-12-06 01:25:02 -08:00
|
|
|
|
2015-10-06 00:59:29 -07:00
|
|
|
ActionOverflow:
|
2015-10-07 02:05:50 -07:00
|
|
|
id: ao
|
2015-12-18 01:53:50 -08:00
|
|
|
ActionOvrButton:
|
|
|
|
name: 'about'
|
|
|
|
text: _('About')
|
2015-10-30 06:23:48 -07:00
|
|
|
ActionOvrButton:
|
2015-12-02 03:11:28 -08:00
|
|
|
name: 'network'
|
2015-12-16 02:53:37 -08:00
|
|
|
text: _('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: 'wallets'
|
2015-10-13 03:12:49 -07:00
|
|
|
text: _('Wallets')
|
2015-10-30 06:23:48 -07:00
|
|
|
ActionOvrButton:
|
2015-12-18 01:53:50 -08:00
|
|
|
name: 'settings'
|
|
|
|
text: _('Settings')
|
2015-10-06 00:59:29 -07:00
|
|
|
ScreenManager:
|
|
|
|
id: manager
|
|
|
|
ScreenTabs:
|
|
|
|
id: tabs
|