pub struct ActivityBarRowHit {
pub y_start: f32,
pub y_end: f32,
pub id: WidgetId,
pub tooltip: String,
}Expand description
Per-row hit region produced by the rasteriser, carrying the
item’s WidgetId and tooltip alongside the painted vertical
span. Apps that need both click routing AND hover tooltips (e.g.
vimcode’s GTK activity bar with connect_query_tooltip) read
from this list rather than re-resolving via the layout.
§Coordinate space — relative to the bar
y_start / y_end are measured from the top edge of the rect
passed to [Backend::draw_activity_bar], i.e. the first row always
starts at 0.0 regardless of where the bar sits on screen. They are
not target-surface (absolute) coordinates — this is the opposite
convention from [TabBarHits], whose x spans are absolute.
Callers therefore add the bar’s origin themselves before comparing against a raw click position:
let hit_top = hit.y_start as f32 + activity_bar_bounds.y;Coordinates here are bar-relative offsets, not absolute paint y
values. Each backend’s activity_bar module doc spells out its
conversion. Callers add the bar origin before hit-testing.
Fields§
§y_start: f32Top edge of the row, relative to the bar’s rect.y (first
row is 0.0). Add the bar origin before hit-testing a click.
y_end: f32Bottom edge (exclusive) of the row, relative to the bar’s
rect.y. Add the bar origin before hit-testing a click.
id: WidgetId§tooltip: StringTrait Implementations§
Source§impl Clone for ActivityBarRowHit
impl Clone for ActivityBarRowHit
Auto Trait Implementations§
impl Freeze for ActivityBarRowHit
impl RefUnwindSafe for ActivityBarRowHit
impl Send for ActivityBarRowHit
impl Sync for ActivityBarRowHit
impl Unpin for ActivityBarRowHit
impl UnsafeUnpin for ActivityBarRowHit
impl UnwindSafe for ActivityBarRowHit
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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