Struct ui2::IconButton
source · pub struct IconButton { /* private fields */ }
Implementations§
source§impl IconButton
impl IconButton
pub fn new(id: impl Into<ElementId>, icon: Icon) -> Self
pub fn icon(self, icon: Icon) -> Self
pub fn color(self, color: Color) -> Self
pub fn variant(self, variant: ButtonVariant) -> Self
pub fn state(self, state: InteractionState) -> Self
pub fn selected(self, selected: bool) -> Self
pub fn tooltip( self, tooltip: impl Fn(&mut WindowContext<'_>) -> AnyView + 'static ) -> Self
pub fn on_click( self, handler: impl 'static + Fn(&MouseDownEvent, &mut WindowContext<'_>) ) -> Self
pub fn action(self, action: Box<dyn Action>) -> Self
Trait Implementations§
source§impl Component for IconButton
impl Component for IconButton
source§impl From<IconButton> for ButtonOrIconButton
impl From<IconButton> for ButtonOrIconButton
source§fn from(value: IconButton) -> Self
fn from(value: IconButton) -> Self
Converts to this type from the input type.
source§impl RenderOnce for IconButton
impl RenderOnce for IconButton
type Element = CompositeElement<IconButton>
fn element_id(&self) -> Option<ElementId>
fn render_once(self) -> Self::Element
fn render_into_any(self) -> AnyElement
fn draw<T, R>( self, origin: Point<Pixels>, available_space: Size<T>, cx: &mut WindowContext<'_>, f: impl FnOnce(&mut <Self::Element as Element>::State, &mut WindowContext<'_>) -> R ) -> Rwhere T: Clone + Default + Debug + Into<AvailableSpace>,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere Self: Sized, U: RenderOnce,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere Self: Sized,
fn when_some<T>( self, option: Option<T>, then: impl FnOnce(Self, T) -> Self ) -> Selfwhere Self: Sized,
Auto Trait Implementations§
impl !RefUnwindSafe for IconButton
impl !Send for IconButton
impl !Sync for IconButton
impl Unpin for IconButton
impl !UnwindSafe for IconButton
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