#[non_exhaustive]pub struct UiTarget {
pub key: String,
pub node_id: String,
pub rect: Rect,
pub tooltip: Option<String>,
pub scroll_offset_y: f32,
}Expand description
Hit-test target metadata. key is the author-facing route, while
node_id is the stable laid-out tree path used by artifacts.
tooltip snapshots the node’s tooltip text at the moment the
target was constructed, so the tooltip pass doesn’t have to walk
the live tree to resolve it. This is what makes tooltips work on
virtual-list rows: hit-testing reads last_tree (where the row
has been realized), and the cached text survives into the next
frame’s synthesize_tooltip even though that frame’s tree hasn’t
rebuilt its virtual-list children yet.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.key: String§node_id: String§rect: Rect§tooltip: Option<String>§scroll_offset_y: f32Scroll offset of the deepest scroll subtree inside this hit
target, in logical pixels. 0.0 for widgets that don’t
contain a scroll. Used by widgets like
crate::widgets::text_area to convert a pointer in viewport
space (what the user clicks) into content space (what
cosmic-text’s hit_byte and caret_xy work in) — without
this, clicks after scrolling land on the wrong line because
the content has been shifted up by scroll_offset_y while
the outer’s rect hasn’t moved.
Trait Implementations§
impl StructuralPartialEq for UiTarget
Auto Trait Implementations§
impl Freeze for UiTarget
impl RefUnwindSafe for UiTarget
impl Send for UiTarget
impl Sync for UiTarget
impl Unpin for UiTarget
impl UnsafeUnpin for UiTarget
impl UnwindSafe for UiTarget
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.