pub struct AnyTooltip {
pub view: AnyView,
pub mouse_position: Point<Pixels>,
pub check_visible_and_update: Rc<dyn Fn(Bounds<Pixels>, &mut Window, &mut App) -> bool>,
}Expand description
重导出 App 核心模块(App、Context、Entity、EntityId 等) 包含与工具提示关联的状态。仅当在自定义元素上实现工具提示行为时才需要此结构体。 否则,请使用 Div::tooltip。
Fields§
§view: AnyView用于显示工具提示的视图
mouse_position: Point<Pixels>工具提示展开时鼠标的绝对位置。
check_visible_and_update: Rc<dyn Fn(Bounds<Pixels>, &mut Window, &mut App) -> bool>根据工具提示的边界检查工具提示是否仍应可见,并相应地更新其状态。
这需要在悬停元素的鼠标移动处理程序之上,以处理元素未被绘制的情况
(例如通过使用 visible_on_hover)。
Trait Implementations§
Source§impl Clone for AnyTooltip
impl Clone for AnyTooltip
Source§fn clone(&self) -> AnyTooltip
fn clone(&self) -> AnyTooltip
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AnyTooltip
impl !Send for AnyTooltip
impl !Sync for AnyTooltip
impl !UnwindSafe for AnyTooltip
impl Freeze for AnyTooltip
impl Unpin for AnyTooltip
impl UnsafeUnpin for AnyTooltip
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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