pub trait MaterialElementExt: IntoElement + Sized {
// 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 { ... }
fn context_menu_with<I>(
self,
id: impl Into<ElementId>,
build: impl FnOnce(&mut Window, &mut App) -> I + 'static,
) -> Menu
where I: IntoIterator<Item = MenuItem> { ... }
}Expand description
Fluent postfix composition helpers for attaching Material badges, tooltips, and context menus to any GPUI element.
Provided Methods§
Sourcefn badge_label(self, text: impl Into<SharedString>) -> Badge
fn badge_label(self, text: impl Into<SharedString>) -> Badge
Anchors a text Badge to this element’s upper trailing edge.
Sourcefn badge_count(self, count: usize, maximum: usize) -> Badge
fn badge_count(self, count: usize, maximum: usize) -> Badge
Anchors a capped numeric Badge to this element’s upper trailing edge.
Sourcefn tooltip(
self,
id: impl Into<ElementId>,
text: impl Into<SharedString>,
) -> Tooltip
fn tooltip( self, id: impl Into<ElementId>, text: impl Into<SharedString>, ) -> Tooltip
Wraps this element as the trigger of a plain Tooltip.
Wraps this element as the trigger of a secondary-click context Menu.
Wraps this element as the trigger of a secondary-click context Menu
whose items are built lazily only while the menu is open.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".