Пример #1
0
 def show_menu(self):
     menu = MDDropdownMenu(items=self.menu_items,
                           width_mult=4,
                           pos_hint={
                               'top': 1,
                               'right': 1
                           })
     menu.open(self)
Пример #2
0
 def show_menu(self, item):
     """Show selected item menu."""
     _item = item.get_item()
     menu_items = [
         {
             'viewclass': 'MDMenuItem',
             'text': 'edit',
             'callback':
             lambda x: self.app.goto(SCREENS_TYPE.EDIT, task=_item)
         },
         {
             'viewclass': 'MDMenuItem',
             'text': 'remove',
             'callback': lambda x: self.remove_task(_item)
         },
         {
             'viewclass': 'MDMenuItem',
             'text': 'mark as finished',
             'callback': lambda x: self.mark_as_finished(_item)
         },
     ]
     MDDropdownMenu(items=menu_items, width_mult=4).open(item)
Пример #3
0
 def on_touch_up(self, touch):
     super().on_touch_up(touch)
     if self.collide_point(*touch.pos) and touch.grab_current is not None:
         if touch.device == "mouse" and touch.button == "right":
             MDDropdownMenu(items=self.menu_items,
                            width_mult=2).open(touch, touch=True)
Пример #4
0
 def menu_button_handler(self, button):
     if self.root.ids.sm.current == "main":
         MDDropdownMenu(items=self.menu_items, width_mult=4).open(button)
Пример #5
0
 def open_menu(self, instance):
     MDDropdownMenu(items=self.right_menu, width_mult=3).open(instance)
Пример #6
0
 async def bind_on_release(self):
     async for _ in self.async_bind("on_release"):
         app = App.get_running_app()
         app.utxo = self.utxo
         MDDropdownMenu(items=app.utxo_menu_items, width_mult=4).open(self)
Пример #7
0
 def show_options(self):
     MDDropdownMenu(items=self.menu_items, width_mult=4).open(self)
Пример #8
0
 def r_menu(self, caller):
     MDDropdownMenu(items=self.r_menu_items, width_mult=4).open(caller)
Пример #9
0
 def open_option_menu(self, instance):
     MDDropdownMenu(items=self.option_list, width_mult=2).open(self)