kivy updates

This commit is contained in:
ThomasV 2015-12-02 12:11:28 +01:00
parent 95bf92b683
commit 6ec610c359
12 changed files with 65 additions and 44 deletions

View File

@ -301,7 +301,7 @@
<ActionOvrButton@ActionButton> <ActionOvrButton@ActionButton>
on_release: on_release:
if self.parent: self.parent.parent.dismiss() if self.parent: self.parent.parent.dismiss()
app.popup_dialog(self.text.lower()) app.popup_dialog(self.name)
BoxLayout: BoxLayout:
@ -345,15 +345,19 @@ BoxLayout:
id: ao id: ao
ActionOvrButton: ActionOvrButton:
text: _('Network') text: _('Network')
name: 'network'
on_parent: on_parent:
# when widget overflow drop down is shown, adjust the width # when widget overflow drop down is shown, adjust the width
parent = args[1] parent = args[1]
if parent: ao._dropdown.width = sp(200) if parent: ao._dropdown.width = sp(200)
ActionOvrButton: ActionOvrButton:
name: 'settings'
text: _('Settings') text: _('Settings')
ActionOvrButton: ActionOvrButton:
name: 'wallets'
text: _('Wallets') text: _('Wallets')
ActionOvrButton: ActionOvrButton:
name: 'plugins'
text: _('Plugins') text: _('Plugins')
ScreenManager: ScreenManager:

View File

@ -96,6 +96,16 @@ class ElectrumWindow(App):
'''Number of zeros used while representing the value in base_unit. '''Number of zeros used while representing the value in base_unit.
''' '''
def get_amount_text(self, amount_str, is_fiat):
text = amount_str + ' ' + self.base_unit if amount_str else ''
if text:
amount = self.get_amount(text)
x = run_hook('format_amount_and_units', amount)
if x:
text += ' / ' + x
return text
def get_amount(self, amount_str): def get_amount(self, amount_str):
a, u = amount_str.split() a, u = amount_str.split()
assert u == self.base_unit assert u == self.base_unit
@ -733,7 +743,7 @@ class ElectrumWindow(App):
info_bubble.background_image = 'atlas://data/images/defaulttheme/bubble' info_bubble.background_image = 'atlas://data/images/defaulttheme/bubble'
info_bubble.message = text info_bubble.message = text
if not pos: if not pos:
pos = (win.center[0], win.center[1] - (info_bubble.height/2)) pos = (win.center[0], win.center[1] - (info_bubble.height/2))
info_bubble.show(pos, duration, width, modal=modal, exit=exit) info_bubble.show(pos, duration, width, modal=modal, exit=exit)
def tx_dialog(self, tx_hash): def tx_dialog(self, tx_hash):

View File

@ -128,6 +128,7 @@ android.add_libs_armeabi = lib/android/*.so
#ios.codesign.release = %(ios.codesign.debug)s #ios.codesign.release = %(ios.codesign.debug)s
[buildozer] [buildozer]
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output)) # (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))

View File

@ -143,7 +143,6 @@ class HistoryScreen(CScreen):
if count == 8 and not see_all: if count == 8 and not see_all:
break break
history_card.ids.btn_see_all.opacity = (0 if count < 8 else 1)
class ScreenAddress(CScreen): class ScreenAddress(CScreen):

View File

@ -11,16 +11,22 @@ Popup:
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
size_hint: 0.8, 1 size_hint: 0.8, 1
BoxLayout: BoxLayout:
size_hint: 1, None size_hint: 1, None
height: '48dp' height: '48dp'
Label: Label:
id: a id: a
amount: '' amount: ''
text: self.amount + ' ' + app.base_unit if self.amount else '' is_fiat: False
text: app.get_amount_text(self.amount, self.is_fiat)
Widget: Widget:
size_hint_x: 1 size_hint_x: 1
Button:
id: button_fiat
size_hint: 1, None
height: '48dp'
text: '<->'
on_release: a.is_fiat = not a.is_fiat
Widget: Widget:
size_hint: 1, 1 size_hint: 1, 1
@ -72,8 +78,6 @@ Popup:
text: 'Max' text: 'Max'
on_release: a.amount = app.get_max_amount() on_release: a.amount = app.get_max_amount()
BoxLayout: BoxLayout:
size_hint: 1, None size_hint: 1, None
height: '48dp' height: '48dp'

View File

@ -103,18 +103,6 @@
CardSeparator CardSeparator
<CardRecentActivity@Card> <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: GridLayout:
id: content id: content
spacing: '7dp' spacing: '7dp'

View File

@ -23,14 +23,12 @@ Popup:
text: '' text: ''
values: app.network.get_servers() values: app.network.get_servers()
Widget:
size_hint: 1, 1
BoxLayout: BoxLayout:
Button: Widget:
size_hint: 0.5, None size_hint: 0.5, None
height: '48dp'
text: _('Cancel')
on_release:
nd.dismiss()
Button: Button:
size_hint: 0.5, None size_hint: 0.5, None
height: '48dp' height: '48dp'
@ -39,5 +37,3 @@ Popup:
app.network.set_parameters(host.text, nd.port, nd.protocol, nd.proxy, auto_connect.active) app.network.set_parameters(host.text, nd.port, nd.protocol, nd.proxy, auto_connect.active)
nd.dismiss() nd.dismiss()
Widget:
size_hint: 1, 1

View File

@ -11,11 +11,17 @@ Popup:
id: plugins_list id: plugins_list
on_parent: on_parent:
app.show_plugins(plugins_list) app.show_plugins(plugins_list)
Button:
size_hint: 1, None
height: '48dp'
text: _('Close')
on_release: popup.dismiss()
Widget: Widget:
size_hint: 1, 0.8 size_hint: 1, 1
BoxLayout:
Widget:
size_hint: 0.5, None
Button:
size_hint: 0.5, None
height: '48dp'
text: _('OK')
on_release:
popup.dismiss()

View File

@ -29,12 +29,17 @@ Popup:
size_hint: 1, None size_hint: 1, None
height: '48dp' height: '48dp'
multiline: False multiline: False
Button:
size_hint: 1, None
height: '48dp'
text: _('Close')
on_release: settings.dismiss()
Widget: Widget:
size_hint: 1, 1 size_hint: 1, 1
BoxLayout:
Widget:
size_hint: 0.5, None
Button:
size_hint: 0.5, None
height: '48dp'
text: _('OK')
on_release:
settings.dismiss()

View File

@ -8,6 +8,8 @@
Popup: Popup:
title: _('Wallets')
id: popup
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
GridLayout: GridLayout:
@ -27,8 +29,14 @@ Popup:
id: wallet_selector id: wallet_selector
path: os.path.dirname(app.wallet.storage.path) path: os.path.dirname(app.wallet.storage.path)
on_selection: text_input.text = os.path.basename(self.selection[0]) if self.selection else '' on_selection: text_input.text = os.path.basename(self.selection[0]) if self.selection else ''
size_hint: 1, 1
#WalletSelector: BoxLayout:
# id: wallet_selection Widget:
# size_hint: 1, None size_hint: 0.5, None
# height: blue_bottom.item_height Button:
size_hint: 0.5, None
height: '48dp'
text: _('OK')
on_release:
popup.dismiss()

View File

@ -504,8 +504,8 @@ class ElectrumWindow(QMainWindow, PrintError):
def format_amount_and_units(self, amount): def format_amount_and_units(self, amount):
text = self.format_amount(amount) + ' '+ self.base_unit() text = self.format_amount(amount) + ' '+ self.base_unit()
x = run_hook('format_amount_and_units', amount) x = run_hook('format_amount_and_units', amount)
if x: if text and x:
text += x text += ' (%s)'%x
return text return text
def get_decimal_point(self): def get_decimal_point(self):

View File

@ -313,7 +313,7 @@ class FxPlugin(BasePlugin, ThreadJob):
@hook @hook
def format_amount_and_units(self, btc_balance): def format_amount_and_units(self, btc_balance):
rate = self.exchange_rate() rate = self.exchange_rate()
return '' if rate is None else " (%s %s)" % (self.value_str(btc_balance, rate), self.ccy) return '' if rate is None else "%s %s" % (self.value_str(btc_balance, rate), self.ccy)
@hook @hook
def get_fiat_status_text(self, btc_balance): def get_fiat_status_text(self, btc_balance):