pub struct Tooltip { /* private fields */ }Implementations§
Source§impl Tooltip
impl Tooltip
Sourcepub fn text(
text: impl Into<SharedString>,
_window: &mut Window,
cx: &mut App,
) -> AnyView
pub fn text( text: impl Into<SharedString>, _window: &mut Window, cx: &mut App, ) -> AnyView
A plain text tooltip, built for .tooltip(..).
Sourcepub fn with_keystroke(
text: impl Into<SharedString>,
keystroke: impl Into<SharedString>,
_window: &mut Window,
cx: &mut App,
) -> AnyView
pub fn with_keystroke( text: impl Into<SharedString>, keystroke: impl Into<SharedString>, _window: &mut Window, cx: &mut App, ) -> AnyView
A tooltip that also names the shortcut — the pairing that keeps keyboard affordances discoverable without a menu.
Sourcepub fn for_action(
text: impl Into<SharedString>,
action: &dyn Action,
window: &mut Window,
cx: &mut App,
) -> AnyView
pub fn for_action( text: impl Into<SharedString>, action: &dyn Action, window: &mut Window, cx: &mut App, ) -> AnyView
The same pairing with the chord read off the keymap rather than typed in, so rebinding the action moves the hint with it. Falls back to plain text when nothing is bound.
A tooltip is built on hover, while the surface it describes still holds
focus, so keys::shortcut is the right lookup — use
Tooltip::for_action_in where it is not, such as a button that moves
focus to itself.
Sourcepub fn for_action_in(
text: impl Into<SharedString>,
action: &dyn Action,
context: &str,
window: &mut Window,
cx: &mut App,
) -> AnyView
pub fn for_action_in( text: impl Into<SharedString>, action: &dyn Action, context: &str, window: &mut Window, cx: &mut App, ) -> AnyView
Tooltip::for_action against a named key context instead of whatever
holds focus.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tooltip
impl RefUnwindSafe for Tooltip
impl Send for Tooltip
impl Sync for Tooltip
impl Unpin for Tooltip
impl UnsafeUnpin for Tooltip
impl UnwindSafe for Tooltip
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
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