pub struct MockMenuBar(/* private fields */);Expand description
A menu bar that keeps the menus last set. Every clone is the same menu bar.
Implementations§
Source§impl MockMenuBar
impl MockMenuBar
pub fn new() -> MockMenuBar
Sourcepub fn taking(
self,
shortcuts: impl IntoIterator<Item = MenuShortcut>,
) -> MockMenuBar
pub fn taking( self, shortcuts: impl IntoIterator<Item = MenuShortcut>, ) -> MockMenuBar
A menu bar that takes a key-down offered (perform_key_equivalent) whose logical key is
one of shortcuts’ keys. A key’s data carries no modifiers, which a host’s menu bar reads
from the system’s own event, so the mock matches the key alone.
The menus last set.
Trait Implementations§
Source§impl Clone for MockMenuBar
impl Clone for MockMenuBar
Source§impl Default for MockMenuBar
impl Default for MockMenuBar
Source§impl MenuBar for MockMenuBar
impl MenuBar for MockMenuBar
Replaces the app’s menu bar whole: its top-level menus, each a
MenuEntry::Submenu. A
choice reaches the app as EmbedderClient::menu_selected(id).Source§fn perform_key_equivalent(&self, key: &KeyData) -> bool
fn perform_key_equivalent(&self, key: &KeyData) -> bool
Offers the menu bar a key-down the app kept back when it came and has since left
unhandled, as Chrome sends on a key its page did not consume; answers whether an item took
it, which then reaches the app as
EmbedderClient::menu_selected. For an app that answers
a key later than the host must, such as one that waits on another thread: the host’s own
order, the framework first and the menu bar after, needs no call. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for MockMenuBar
impl !Send for MockMenuBar
impl !Sync for MockMenuBar
impl !UnwindSafe for MockMenuBar
impl Forget for MockMenuBar
impl Freeze for MockMenuBar
impl Move for MockMenuBar
impl Unpin for MockMenuBar
impl UnsafeUnpin for MockMenuBarwhere
*const RcInner<RefCell<MenuBarState>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<MenuBarState>>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more