pub struct Item<M> { /* private fields */ }Expand description
What a widget shows in the bar.
Implementations§
Source§impl<M> Item<M>
impl<M> Item<M>
pub fn new(content: Node<M>) -> Self
Takes no space in the bar. For widgets with nothing to show, like a battery on a desktop.
Sourcepub fn on_press(self, message: M) -> Self
pub fn on_press(self, message: M) -> Self
Sent on a primary click. Replaces the default of toggling the popover.
Sourcepub fn on_secondary(self, message: M) -> Self
pub fn on_secondary(self, message: M) -> Self
Sent on a secondary (right) click.
Sourcepub fn on_scroll(self, up: M, down: M) -> Self
pub fn on_scroll(self, up: M, down: M) -> Self
Sent once per scroll step over the item, up or down. The host turns smooth touchpad
scrolling into steps.
pub fn map<N: 'static>(self, f: &(impl Fn(M) -> N + Clone + 'static)) -> Item<N>where
M: 'static,
Auto Trait Implementations§
impl<M> !RefUnwindSafe for Item<M>
impl<M> !Send for Item<M>
impl<M> !Sync for Item<M>
impl<M> !UnwindSafe for Item<M>
impl<M> Freeze for Item<M>
impl<M> Unpin for Item<M>
impl<M> UnsafeUnpin for Item<M>
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