You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
224 lines
6.8 KiB
224 lines
6.8 KiB
#: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
|
|
|
|
|