Skip to main content

DateIndexedScrollbar

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

pub fn new(semantic_id: impl Into<String>) -> DateIndexedScrollbar

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

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

Normalise an offset without trusting callers to have clamped it.

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>

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>

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>

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>

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>

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>

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

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>

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], )

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

§

fn clone(&self) -> DateIndexedScrollbar

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for DateIndexedScrollbar

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> MaybeSendSync for T
where T: Send + Sync + ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T

§

impl<T> WasmNotSync for T
where T: Sync,