Struct StripRail
pub struct StripRail {
pub content: Rect,
pub count: usize,
pub focused: usize,
pub visible: Vec<usize>,
}Expand description
A map of the windows along one strip, and where on it the user is
standing — the counterpart of StripRibbon for the axis a strip can
overflow. Three facts in order of importance: how many windows the
strip holds (one segment each — the fact that makes travel worth
attempting), which has focus (the long, bright segment), and which are
on screen right now (the middle weight, sliding as the strip pans).
A control, not a readout: clicking a segment focuses that window. Bottom edge, because the disc owns the left and the strip ribbon owns the right.
Fields§
§content: Rect§count: usize§focused: usize§visible: Vec<usize>Empty before the first layout pass has anything to report.
Implementations§
§impl StripRail
impl StripRail
pub fn is_meaningful(&self) -> bool
pub fn is_meaningful(&self) -> bool
One window is not a strip you can travel along, and a single segment would be noise.
pub fn extent(&self) -> f64
pub fn segment_rect(&self, i: usize) -> Option<Rect>
pub fn hit_rect(&self, i: usize) -> Option<Rect>
pub fn hit_rect(&self, i: usize) -> Option<Rect>
Widened past the visible segment to the minimum pointer target across the rail’s short axis.
pub fn hit(&self, p: Point) -> Option<usize>
pub fn draw( &self, scene: &mut Scene, transform: Affine, theme: &Theme, hover: Option<usize>, alpha: f32, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StripRail
impl RefUnwindSafe for StripRail
impl Send for StripRail
impl Sync for StripRail
impl Unpin for StripRail
impl UnsafeUnpin for StripRail
impl UnwindSafe for StripRail
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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