Struct DateIndexedScrollbar
pub struct DateIndexedScrollbar { /* private fields */ }Expand description
A modern chronological scrollbar face plus its ephemeral interaction state. It intentionally has no document binding: scroll position and density are per-user presentation preferences, not shared collection data.
Implementations§
§impl DateIndexedScrollbar
impl DateIndexedScrollbar
pub fn new(semantic_id: impl Into<String>) -> DateIndexedScrollbar
pub fn set_rect(&mut self, rect: Rect)
pub fn set_rect(&mut self, rect: Rect)
The narrow right-edge track used by the widget. Hosts may provide a wider rect for touch-first surfaces; the marker lane expands leftward.
pub fn rect(&self) -> Rect
pub fn is_dragging(&self) -> bool
pub fn set_focus(&mut self, focused: bool)
pub fn is_focused(&self) -> bool
pub fn preview(&self) -> Option<&DateIndexPreview>
pub fn contains_interaction_point(&self, point: Point) -> bool
pub fn contains_interaction_point(&self, point: Point) -> bool
Whether an immediate-mode host should offer this widget first refusal of a pointer press/release. It includes the visible track and the adjacent marker/preview lane, never the collection content itself.
pub fn position(metrics: ScrollMetrics) -> f64
pub fn position(metrics: ScrollMetrics) -> f64
Normalise an offset without trusting callers to have clamped it.
pub fn offset_for(metrics: ScrollMetrics, position: f64) -> f64
pub fn offset_for(metrics: ScrollMetrics, position: f64) -> f64
Convert an absolute position back into the host’s logical offset.
pub fn project_markers(
&self,
markers: &[DateIndexMarker],
limit: usize,
) -> Vec<ProjectedDateMarker>
pub fn project_markers( &self, markers: &[DateIndexMarker], limit: usize, ) -> Vec<ProjectedDateMarker>
Project date markers into at most limit legible ticks. Major
boundaries and the first/last available boundary are retained first;
the remainder is evenly sampled in stable chronological order. The
operation is O(n) over the already-small boundary list and produces a
bounded result for paint and AT export.
pub fn pointer_moved(
&mut self,
cursor: Point,
metrics: ScrollMetrics,
markers: &[DateIndexMarker],
) -> Option<DateIndexIntent>
pub fn pointer_moved( &mut self, cursor: Point, metrics: ScrollMetrics, markers: &[DateIndexMarker], ) -> Option<DateIndexIntent>
Pointer movement updates the hover label and, while captured, returns an absolute scroll target. Call it even after the cursor leaves the track; that is what makes a thumb drag reliable.
pub fn press(
&mut self,
metrics: ScrollMetrics,
markers: &[DateIndexMarker],
) -> Option<DateIndexIntent>
pub fn press( &mut self, metrics: ScrollMetrics, markers: &[DateIndexMarker], ) -> Option<DateIndexIntent>
Press on a marker jumps precisely to that date; press on the thumb starts a captured drag; press elsewhere on the track follows the standard shared scrollbar page behaviour.
pub fn release(&mut self) -> bool
pub fn wheel(
&self,
delta: MouseScrollDelta,
metrics: ScrollMetrics,
) -> Option<DateIndexIntent>
pub fn wheel( &self, delta: MouseScrollDelta, metrics: ScrollMetrics, ) -> Option<DateIndexIntent>
Convert a regular scroll wheel / two-finger scroll delta into an absolute timeline position. The host may decline this when another focused surface owns the gesture.
pub fn key(&self, key: &Key, metrics: ScrollMetrics) -> Option<DateIndexIntent>
pub fn key(&self, key: &Key, metrics: ScrollMetrics) -> Option<DateIndexIntent>
Keyboard parity for pointer behaviour. The normal arrows nudge the
position, Page keys move a viewport, Home/End jump to endpoints, and
+/- expose density without requiring a trackpad gesture.
pub fn handle_event(
&mut self,
event: &WindowEvent,
scale_factor: f64,
metrics: ScrollMetrics,
markers: &[DateIndexMarker],
) -> Option<DateIndexIntent>
pub fn handle_event( &mut self, event: &WindowEvent, scale_factor: f64, metrics: ScrollMetrics, markers: &[DateIndexMarker], ) -> Option<DateIndexIntent>
Translate a winit event for immediate-mode hosts. This deliberately
does not consume pinch gestures: the collection needs the raw pinch
anchor to keep the same item under a user’s fingers while density
changes, so PinchGesture is exposed as an integration seam instead.
pub fn accessibility(
&self,
metrics: ScrollMetrics,
markers: &[DateIndexMarker],
) -> AccessNode
pub fn accessibility( &self, metrics: ScrollMetrics, markers: &[DateIndexMarker], ) -> AccessNode
Stable synthetic semantics for a custom canvas host. The slider is one focus target; projected major/minor boundaries are discoverable jump buttons, bounded with the same projection as paint.
pub fn perform_access_action(
&mut self,
target: &str,
action: &Action,
metrics: ScrollMetrics,
markers: &[DateIndexMarker],
) -> Option<DateIndexIntent>
pub fn perform_access_action( &mut self, target: &str, action: &Action, metrics: ScrollMetrics, markers: &[DateIndexMarker], ) -> Option<DateIndexIntent>
Route AT value and jump actions through the same intent path as real pointer/keyboard input. Hosts should use this instead of separately mutating their scroll state from accessibility actions.
pub fn paint(
&self,
scene: &mut Scene,
transform: Affine,
text_renderer: &mut TextRenderer,
theme: &Theme,
metrics: ScrollMetrics,
markers: &[DateIndexMarker],
)
pub fn paint( &self, scene: &mut Scene, transform: Affine, text_renderer: &mut TextRenderer, theme: &Theme, metrics: ScrollMetrics, markers: &[DateIndexMarker], )
Paint the shared face. No animation is required for meaning: hover, focus, and dragging all have static high-contrast affordances, so reduced-motion themes retain every piece of feedback.
Trait Implementations§
§impl Clone for DateIndexedScrollbar
impl Clone for DateIndexedScrollbar
§fn clone(&self) -> DateIndexedScrollbar
fn clone(&self) -> DateIndexedScrollbar
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DateIndexedScrollbar
impl RefUnwindSafe for DateIndexedScrollbar
impl Send for DateIndexedScrollbar
impl Sync for DateIndexedScrollbar
impl Unpin for DateIndexedScrollbar
impl UnsafeUnpin for DateIndexedScrollbar
impl UnwindSafe for DateIndexedScrollbar
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