Browse Source

remove ununsed classes, use popup to show tx details

283
ThomasV 9 years ago
parent
commit
46249f74d3
  1. 78
      gui/kivy/main.kv
  2. 4
      gui/kivy/main_window.py
  3. 12
      gui/kivy/uix/screens.py
  4. 86
      gui/kivy/uix/ui_screens/history.kv

78
gui/kivy/main.kv

@ -160,20 +160,6 @@
on_release: app.root.children[0].toggle_drawer()
<SendReceiveCardTop@GridLayout>
canvas.before:
BorderImage:
border: 9, 9, 9, 9
source: 'atlas://gui/kivy/theming/light/card_top'
size: self.size
pos:self.pos
padding: '12dp', '22dp', '12dp', 0
cols: 1
size_hint: 1, None
height: '120dp'
spacing: '4dp'
<SendReceiveBlueBottom@GridLayout>
canvas.before:
Color:
@ -190,8 +176,6 @@
padding: '12dp', 0
<CardSeparator@Widget>
size_hint: 1, None
height: dp(1)
@ -246,68 +230,6 @@
id: carousel
<CarouselIndicator@TabbedCarousel>
tab_pos: 'bottom_mid'
tab_height: '32dp'
tab_width: self.tab_height
#background_image: 'atlas://data/images/defaulttheme/action_item'
strip_border: 0, 0, 0, 0
<CloseButton@IconButton>
source: 'atlas://gui/kivy/theming/light/closebutton'
opacity: 1 if self.state == 'normal' else .75
size_hint: None, None
size: '27dp', '27dp'
<-CarouselDialog>
header_color: '#707070ff'
text_color: 0.701, 0.701, 0.701, 1
title_size: '13sp'
title: ''
separator_color: 0.89, 0.89, 0.89, 1
background: 'atlas://gui/kivy/theming/light/tab_btn'
carousel_content: carousel_content
canvas.before:
Color:
rgba: 0, 0, 0, .9
Rectangle:
size: Window.size
pos: 0, 0
Color:
rgba: 1, 1, 1, 1
BorderImage:
border: 12, 12, 12, 12
source: 'atlas://gui/kivy/theming/light/dialog'
size: root.width, root.height - self.carousel_content.tab_height if self.carousel_content else 0
pos: root.x, self.y + self.carousel_content.tab_height if self.carousel_content else 10
BoxLayout:
orientation: 'vertical'
GridLayout:
cols: 1
size_hint: 1, None
height: self.minimum_height
padding: 0, '7sp'
Label:
font_size: root.title_size
text: u'[color={}]{}[/color]'.format(root.header_color, root.title)
text_size: self.width, None
halign: 'left'
size_hint: 1, None
height: self.texture_size[1]
CardSeparator:
color: root.separator_color
height: root.separator_height
FloatLayout:
size_hint: None, None
size: 0, 0
CloseButton:
id: but_close
top: root.top - dp(10)
right: root.right - dp(10)
on_release: root.dismiss()
CarouselIndicator:
id: carousel_content
<CleanHeader@TabbedPanelHeader>
border: 0, 0, 16, 0

4
gui/kivy/main_window.py

@ -717,6 +717,10 @@ class ElectrumWindow(App):
pos = (win.center[0], win.center[1] - (info_bubble.height/2))
info_bubble.show(pos, duration, width, modal=modal, exit=exit)
def tx_dialog(self, tx_hash):
popup = Builder.load_file('gui/kivy/uix/ui_screens/transaction.kv')
popup.tx_hash = tx_hash
popup.open()
def amount_dialog(self, label, callback):
popup = Builder.load_file('gui/kivy/uix/ui_screens/amount.kv')

12
gui/kivy/uix/screens.py

@ -75,18 +75,6 @@ class HistoryScreen(CScreen):
self.ra_dialog = None
super(HistoryScreen, self).__init__(**kwargs)
def show_tx_details(self, item):
ra_dialog = Cache.get('electrum_widgets', 'RecentActivityDialog')
if not ra_dialog:
Factory.register('RecentActivityDialog',
module='electrum_gui.kivy.uix.dialogs.carousel_dialog')
Factory.register('GridView',
module='electrum_gui.kivy.uix.gridview')
ra_dialog = ra_dialog = Factory.RecentActivityDialog()
Cache.append('electrum_widgets', 'RecentActivityDialog', ra_dialog)
ra_dialog.item = item
ra_dialog.open()
def get_history_rate(self, btc_balance, timestamp):
date = timestamp_to_datetime(timestamp)
return run_hook('historical_value_str', btc_balance, date)

86
gui/kivy/uix/ui_screens/history.kv

@ -53,7 +53,7 @@
<RecentActivityItem@CardItem>
icon: 'atlas://gui/kivy/theming/light/important'
address:'no address set'
address: 'no address set'
value: 0
amount: app.format_amount(self.value, True) if self.value is not None else '--'
amount_color: '#DB3627' if self.value < 0 else '#2EA442'
@ -63,7 +63,7 @@
spacing: '9dp'
on_release:
app.history_screen.show_tx_details(root)
app.tx_dialog(root.tx_hash)
BoxLayout:
size_hint: 1, None
spacing: '8dp'
@ -123,78 +123,6 @@
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'
@ -209,16 +137,6 @@ HistoryScreen:
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

Loading…
Cancel
Save