Skip to main content

Module scroll

Module scroll 

Source
Expand description

A bounded region with a themed scrollbar.

The scroll area is honest about two different things a viewport can mean. There is nothing more — the content fits, and no scrollbar is drawn or published — and there is more, off screen — a scrollbar node carries how far the content reaches and how far it has been scrolled, so a test can tell the two apart instead of guessing from what happens to be visible.

The scrollbar never covers what it hides. Its track is a sibling of the viewport rather than a layer over it, and the gutter is reserved for every axis the caller enabled, so turning a scrollbar on cannot reflow the content that decided whether it was needed.

This is the same rule List follows: scroll position is transient view state, so it is held in an application global keyed by semantic identity rather than by the caller.

Structs§

ScrollArea
A scrollable region.

Enums§

ScrollAxis
Which way the content may be scrolled.

Functions§

scroll_offset
How far the region with this identity has been scrolled, in pixels down and across from the start of its content.
scroll_to
Puts the region with this identity at offset, measured the same way scroll_offset reports it.