Refactor mpybit and add msg_composer dropdown
This commit is contained in:
parent
76d6e4009b
commit
929d9af945
|
@ -38,6 +38,7 @@
|
|||
id: btn
|
||||
background_color: app.theme_cls.primary_dark
|
||||
values: app.identity_list
|
||||
on_text: root.auto_fill_fromaddr() if self.text != 'Select' else ''
|
||||
option_cls: Factory.get("ComposerSpinnerOption")
|
||||
background_normal: ''
|
||||
background_color: app.theme_cls.primary_color
|
||||
|
|
|
@ -292,6 +292,7 @@ MDNavigationLayout:
|
|||
elevation_normal: 8
|
||||
md_bg_color: [0.941, 0, 0,1]
|
||||
on_press: app.root.ids.scr_mngr.current = 'create'
|
||||
on_press: app.clear_composer()
|
||||
|
||||
|
||||
<SwipeToDeleteItem>:
|
||||
|
|
|
@ -309,6 +309,28 @@ class NavigateApp(MDApp):
|
|||
AppClosingPopup().open()
|
||||
return True
|
||||
|
||||
def clear_composer(self):
|
||||
"""If slow down, the new composer edit screen"""
|
||||
self.set_navbar_for_composer()
|
||||
composer_obj = self.root.ids.id_create.children[1].ids
|
||||
composer_obj.ti.text = ''
|
||||
composer_obj.composer_dropdown.text = 'Select'
|
||||
composer_obj.txt_input.text = ''
|
||||
composer_obj.subject.text = ''
|
||||
composer_obj.body.text = ''
|
||||
self.kivy_state_obj.in_composer = True
|
||||
self.kivy_state_obj = False
|
||||
|
||||
def set_navbar_for_composer(self):
|
||||
"""Clearing toolbar data when composer open"""
|
||||
self.root.ids.toolbar.left_action_items = [
|
||||
['arrow-left', lambda x: self.back_press()]]
|
||||
self.root.ids.toolbar.right_action_items = [
|
||||
['refresh',
|
||||
lambda x: self.root.ids.id_create.children[1].reset_composer()],
|
||||
['send',
|
||||
lambda x: self.root.ids.id_create.children[1].send(self)]]
|
||||
|
||||
def set_identicon(self, text):
|
||||
"""Show identicon in address spinner"""
|
||||
img = identiconGeneration.generate(text)
|
||||
|
|
Reference in New Issue
Block a user