Skip to main content

MaterialElementExt

Trait MaterialElementExt 

Source
pub trait MaterialElementExt: Sized + IntoElement {
    // Provided methods
    fn badge_dot(self) -> Badge { ... }
    fn badge_label(self, text: impl Into<SharedString>) -> Badge { ... }
    fn badge_count(self, count: usize, maximum: usize) -> Badge { ... }
    fn tooltip(
        self,
        id: impl Into<ElementId>,
        text: impl Into<SharedString>,
    ) -> Tooltip { ... }
    fn context_menu(
        self,
        id: impl Into<ElementId>,
        items: impl IntoIterator<Item = MenuItem>,
    ) -> Menu { ... }
}
Expand description

Fluent postfix composition helpers for attaching Material badges, tooltips, and context menus to any GPUI element.

Provided Methods§

Source

fn badge_dot(self) -> Badge

Anchors a small dot Badge to this element’s upper trailing edge.

Source

fn badge_label(self, text: impl Into<SharedString>) -> Badge

Anchors a text Badge to this element’s upper trailing edge.

Source

fn badge_count(self, count: usize, maximum: usize) -> Badge

Anchors a capped numeric Badge to this element’s upper trailing edge.

Source

fn tooltip( self, id: impl Into<ElementId>, text: impl Into<SharedString>, ) -> Tooltip

Wraps this element as the trigger of a plain Tooltip.

Source

fn context_menu( self, id: impl Into<ElementId>, items: impl IntoIterator<Item = MenuItem>, ) -> Menu

Wraps this element as the trigger of a secondary-click context Menu.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§