Expand description
An explicit scrollbar: a track, a thumb that reports the scroll position, and a thumb the user can drag.
A scroll indicator that only reports is half a scrollbar. On a desktop, and on any platform driven by a mouse, the bar is also a control: grabbing the thumb and pulling it is how a long document is crossed, and a bar that cannot be grabbed sends the user back to the wheel for every long jump.
The thumb geometry is crate::scrollbar, shared with the curved indicator
a round watch draws, so both answer “how long is the thumb and where does it
sit” the same way. The drag is Modifier::draggable, so pulling a thumb
obeys the same touch slop and axis locking as scrolling the content itself.
Structs§
- Scrollbar
Colors - The colours a
Scrollbarpaints with. - Scrollbar
Spec - How a
Scrollbaris drawn and how short its thumb may get.
Constants§
- DEFAULT_
MIN_ THUMB_ EXTENT - How short the thumb may get, in logical pixels.
- DEFAULT_
SCROLLBAR_ THICKNESS - How wide a bar is across its short axis.
Functions§
- Horizontal
Scrollbar - A horizontal scrollbar for
state. - Scrollbar
- A scrollbar along
axis, drawn and bounded byspec. - Vertical
Scrollbar - A vertical scrollbar for
state, drawn down the space the modifier gives it. - draw_
scrollbar - Draws a scrollbar into a scope whose bounds are the whole bar.