pub struct TooltipPositioner { /* private fields */ }Expand description
Positioning specification returned from Tooltip::positioner.
Choose TooltipPositioner::side to place the tooltip along a side of a
trigger with automatic viewport flipping, or TooltipPositioner::corner
to anchor a corner of the tooltip at an explicit window coordinate. The
tooltip host applies viewport margins and pointer occlusion automatically.
Implementations§
Source§impl TooltipPositioner
impl TooltipPositioner
Sourcepub fn side(trigger_bounds: Bounds<Pixels>) -> Self
pub fn side(trigger_bounds: Bounds<Pixels>) -> Self
Places the tooltip on a side of trigger_bounds, flipping when needed.
Sourcepub fn corner(anchor: Anchor, position: Point<Pixels>) -> Self
pub fn corner(anchor: Anchor, position: Point<Pixels>) -> Self
Places anchor’s corner of the tooltip at position, clamping to the viewport.
Sourcepub fn position(self, position: Point<Pixels>) -> Self
pub fn position(self, position: Point<Pixels>) -> Self
Updates the requested corner position. Has no effect on a side-positioned tooltip.
Sourcepub fn placement(self, placement: TooltipPlacement) -> Self
pub fn placement(self, placement: TooltipPlacement) -> Self
Sets the preferred side. Only meaningful for TooltipPositioner::side.
Sourcepub fn offset(self, offset: Pixels) -> Self
pub fn offset(self, offset: Pixels) -> Self
Sets the gap between the trigger and the tooltip in logical pixels.
Only meaningful for TooltipPositioner::side.
Trait Implementations§
Source§impl Clone for TooltipPositioner
impl Clone for TooltipPositioner
impl Copy for TooltipPositioner
Source§impl Debug for TooltipPositioner
impl Debug for TooltipPositioner
Source§impl PartialEq for TooltipPositioner
impl PartialEq for TooltipPositioner
impl StructuralPartialEq for TooltipPositioner
Auto Trait Implementations§
impl Forget for TooltipPositioner
impl Freeze for TooltipPositioner
impl Move for TooltipPositioner
impl RefUnwindSafe for TooltipPositioner
impl Send for TooltipPositioner
impl Sync for TooltipPositioner
impl Unpin for TooltipPositioner
impl UnsafeUnpin for TooltipPositioner
impl UnwindSafe for TooltipPositioner
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
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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