def show_menu(self): menu = MDDropdownMenu(items=self.menu_items, width_mult=4, pos_hint={ 'top': 1, 'right': 1 }) menu.open(self)
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)
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)
def menu_button_handler(self, button): if self.root.ids.sm.current == "main": MDDropdownMenu(items=self.menu_items, width_mult=4).open(button)
def open_menu(self, instance): MDDropdownMenu(items=self.right_menu, width_mult=3).open(instance)
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)
def show_options(self): MDDropdownMenu(items=self.menu_items, width_mult=4).open(self)
def r_menu(self, caller): MDDropdownMenu(items=self.r_menu_items, width_mult=4).open(caller)
def open_option_menu(self, instance): MDDropdownMenu(items=self.option_list, width_mult=2).open(self)