pub struct AppBarItem { /* private fields */ }Expand description
One action with an inline representation and an overflow menu representation.
Implementations§
Source§impl AppBarItem
impl AppBarItem
Sourcepub fn clickable<E: IntoElement>(
id: impl Into<ElementId>,
label: impl Into<SharedString>,
icon: impl Fn() -> E + 'static,
) -> Self
pub fn clickable<E: IntoElement>( id: impl Into<ElementId>, label: impl Into<SharedString>, icon: impl Fn() -> E + 'static, ) -> Self
Creates an icon button and a matching named menu command. The icon factory may be called for either representation.
Sourcepub fn custom(
id: impl Into<ElementId>,
inline: impl IntoElement,
menu: impl FnOnce(AppBarMenuState) -> MenuItem + 'static,
) -> Self
pub fn custom( id: impl Into<ElementId>, inline: impl IntoElement, menu: impl FnOnce(AppBarMenuState) -> MenuItem + 'static, ) -> Self
Supplies an inline element and the corresponding Material menu item.
Sourcepub fn disabled(self, disabled: bool) -> Self
pub fn disabled(self, disabled: bool) -> Self
Disables the action in both its inline and overflow menu representations.
Sourcepub fn on_activate(
self,
action: impl Fn(&mut Window, &mut App) + 'static,
) -> Self
pub fn on_activate( self, action: impl Fn(&mut Window, &mut App) + 'static, ) -> Self
Sets the activation callback for both representations of a clickable item.
Auto Trait Implementations§
impl !RefUnwindSafe for AppBarItem
impl !Send for AppBarItem
impl !Sync for AppBarItem
impl !UnwindSafe for AppBarItem
impl Forget for AppBarItem
impl Freeze for AppBarItem
impl Move for AppBarItem
impl Unpin for AppBarItem
impl UnsafeUnpin for AppBarItem
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more