Refactor mpybit and add msg_composer dropdown

This commit is contained in:
shekhar-cis 2022-11-16 18:26:40 +05:30
parent 76d6e4009b
commit 929d9af945
Signed by untrusted user: shekhar-cis
GPG Key ID: F4F00AB04E83F9A7
3 changed files with 24 additions and 0 deletions

View File

@ -38,6 +38,7 @@
id: btn id: btn
background_color: app.theme_cls.primary_dark background_color: app.theme_cls.primary_dark
values: app.identity_list values: app.identity_list
on_text: root.auto_fill_fromaddr() if self.text != 'Select' else ''
option_cls: Factory.get("ComposerSpinnerOption") option_cls: Factory.get("ComposerSpinnerOption")
background_normal: '' background_normal: ''
background_color: app.theme_cls.primary_color background_color: app.theme_cls.primary_color

View File

@ -292,6 +292,7 @@ MDNavigationLayout:
elevation_normal: 8 elevation_normal: 8
md_bg_color: [0.941, 0, 0,1] md_bg_color: [0.941, 0, 0,1]
on_press: app.root.ids.scr_mngr.current = 'create' on_press: app.root.ids.scr_mngr.current = 'create'
on_press: app.clear_composer()
<SwipeToDeleteItem>: <SwipeToDeleteItem>:

View File

@ -309,6 +309,28 @@ class NavigateApp(MDApp):
AppClosingPopup().open() AppClosingPopup().open()
return True 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): def set_identicon(self, text):
"""Show identicon in address spinner""" """Show identicon in address spinner"""
img = identiconGeneration.generate(text) img = identiconGeneration.generate(text)