Skip to main content

Module scrollbar

Module scrollbar 

Source
Expand description

Where a scrollbar’s thumb sits and how long it is.

Pure arithmetic over three lengths — how much content there is, how much of it is on screen, how far it has travelled — shared by every indicator that reports a scroll position: the rectangular Scrollbar and the curved indicator a round watch draws.

What differs between them is only how short and how long the thumb is allowed to get, which is why ThumbBounds is a parameter rather than a constant here.

Structs§

ThumbBounds
How short and how long a thumb may get, as fractions of the track.
ThumbGeometry
Thumb length and position, both as fractions of the track.

Functions§

content_delta_for_thumb_drag
How far the content moves when the thumb is dragged delta along a track of track, given the thumb it currently shows.
thumb_geometry
The thumb for a scroll position, or None when the content fits and there is nothing to indicate.