Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def on_active_color_type(self, *args):
self._set_active_color(args)
class NavigationDrawerSubheader(OneLineListItem):
'''
A subheader for separating content in :class:`MDNavigationDrawer`
Works well alongside :class:`NavigationDrawerDivider`
'''
disabled = True
divider = None
theme_text_color = 'Secondary'
class NavigationDrawerDivider(OneLineListItem):
'''
A small full-width divider that can be placed in the :class:`MDNavigationDrawer`
'''
disabled = True
divider = None
_txt_top_pad = NumericProperty(dp(8))
_txt_bot_pad = NumericProperty(dp(8))
def __init__(self, **kwargs):
super(OneLineListItem, self).__init__(**kwargs)
self.height = dp(16)
class MDNavigationDrawer(BoxLayout, ThemableBehavior, RectangularElevationBehavior):
'''
'''
def create_item(self, account):
"""
Creates an account list item from given account.
"""
address = "0x" + account.address.hex()
list_item = OneLineListItem(text=address)
# makes sure the address doesn't overlap on small screen
list_item.ids._lbl_primary.shorten = True
list_item.account = account
list_item.bind(on_release=lambda x: self.on_release(x))
return list_item
def _set_active_color_primary(self, *args):
if self.active_color_type == 'primary':
self._active_color = self.theme_cls.primary_color
def _set_active_color_accent(self, *args):
if self.active_color_type == 'accent':
self._active_color = self.theme_cls.accent_color
def on_icon(self, instance, value):
self.ids['_icon'].text = "{}".format(md_icons[value])
def on_active_color_type(self, *args):
self._set_active_color(args)
class NavigationDrawerSubheader(OneLineListItem):
'''
A subheader for separating content in :class:`MDNavigationDrawer`
Works well alongside :class:`NavigationDrawerDivider`
'''
disabled = True
divider = None
theme_text_color = 'Secondary'
class NavigationDrawerDivider(OneLineListItem):
'''
A small full-width divider that can be placed in the :class:`MDNavigationDrawer`
'''
disabled = True
divider = None
def create_item(self, account):
"""
Creates an account list item from given account.
"""
# circular ref
from pywallet.controller import Controller
address = "0x" + account.address.hex()
# gets the alias if exists
try:
text = Controller.get_address_alias(address)
except KeyError:
text = address
list_item = OneLineListItem(text=text)
# makes sure the address doesn't overlap on small screen
list_item.ids._lbl_primary.shorten = True
list_item.account = account
list_item.bind(on_release=lambda x: self.on_release(x))
return list_item
def on_active_color_type(self, *args):
self._set_active_color(args)
class NavigationDrawerSubheader(OneLineListItem):
'''
A subheader for separating content in :class:`MDNavigationDrawer`
Works well alongside :class:`NavigationDrawerDivider`
'''
disabled = True
divider = None
theme_text_color = 'Secondary'
class NavigationDrawerDivider(OneLineListItem):
'''
A small full-width divider that can be placed in the :class:`MDNavigationDrawer`
'''
disabled = True
divider = None
_txt_top_pad = NumericProperty(dp(8))
_txt_bot_pad = NumericProperty(dp(8))
def __init__(self, **kwargs):
super(OneLineListItem, self).__init__(**kwargs)
self.height = dp(16)
class MDNavigationDrawer(BoxLayout, ThemableBehavior, RectangularElevationBehavior):
'''
'''
def __init__(self, **kwargs):
super(OneLineListItem, self).__init__(**kwargs)
self.height = dp(16)
def _set_active_color_primary(self, *args):
if self.active_color_type == 'primary':
self._active_color = self.theme_cls.primary_color
def _set_active_color_accent(self, *args):
if self.active_color_type == 'accent':
self._active_color = self.theme_cls.accent_color
def on_icon(self, instance, value):
self.ids['_icon'].text = u"{}".format(md_icons[value])
def on_active_color_type(self, *args):
self._set_active_color(args)
class NavigationDrawerSubheader(OneLineListItem):
'''
A subheader for separating content in :class:`MDNavigationDrawer`
Works well alongside :class:`NavigationDrawerDivider`
'''
disabled = True
divider = None
theme_text_color = 'Secondary'
class NavigationDrawerDivider(OneLineListItem):
'''
A small full-width divider that can be placed in the :class:`MDNavigationDrawer`
'''
disabled = True
divider = None