diff --git a/src/bitmessagekivy/main.kv b/src/bitmessagekivy/main.kv index 4b4316d4..1b7b2a6b 100644 --- a/src/bitmessagekivy/main.kv +++ b/src/bitmessagekivy/main.kv @@ -46,14 +46,24 @@ BoxLayout: title: app.getCurrentAccount() background_color: app.theme_cls.primary_dark left_action_items: [['menu', lambda x: app.nav_drawer.toggle()]] - Button: - text:"EXIT" - color: 0,0,0,1 - background_color: (0,0,0,0) - size_hint_y: 0.4 - size_hint_x: 0.1 - pos_hint: {'x': 0.8, 'y':0.4} - on_press: app.say_exit() + + ActionView: + SearchBar: + size_hint_x: 1.7 + size_hint_y: .5 + pos_hint: {'x': 0, 'center_y':.5} + on_text_validate: searchbutt.trigger_action() + + ActionPrevious: + with_previous: False + app_icon: '' + + ActionOverflow: + ActionButton: + text: 'Filters' + ActionButton: + text: 'Exit' + on_press: app.say_exit() ScreenManager: id: scr_mngr diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index a5241e0a..1d4f7178 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -20,6 +20,7 @@ from helper_ackPayload import genAckPayload from addresses import decodeAddress, addBMIfNotPresent from helper_sql import sqlExecute from kivy.core.window import Window +from kivy.uix.actionbar import ActionItem statusIconColor = 'red' @@ -43,11 +44,15 @@ class NavigateApp(App, TextInput): return main_widget def _key_handler(self, instance, key, *args): + """Escape key manages previous screen on back.""" if key is 27: + print(args) + print(instance) self.set_previous_screen() return True def set_previous_screen(self): + """Set previous screen based on back.""" if self.root.ids.scr_mngr.current != 'inbox': self.root.ids.scr_mngr.transition.direction = 'left' self.root.ids.scr_mngr.current = 'inbox' @@ -401,5 +406,15 @@ class NewIdentity(Screen): self.manager.current = 'add_sucess' +class SearchBar(TextInput, ActionItem): + def __init__(self, *args, **kwargs): + super(SearchBar, self).__init__(*args, **kwargs) + self.hint_text = 'Search' + + def search(self): + request = self.text + return str(request) + + if __name__ == '__main__': NavigateApp().run() diff --git a/src/images/search.png b/src/images/search.png new file mode 100644 index 00000000..42a1e45a Binary files /dev/null and b/src/images/search.png differ