Skip to main content

Module scroll_view

Module scroll_view 

Source
Expand description

ScrollView — scrolling container with egui-style scrollbars.

Supports vertical, horizontal, or bidirectional scrolling. The scrollbar can be styled in detail (bar width, margins, fade, solid vs floating) via ScrollBarStyle — set by value, by builder, or bound to an Rc<Cell<ScrollBarStyle>> for live tweaking (used by the demo Appearance tab).

§Coordinate system

All local coordinates are Y-up. scroll_offset is “how far the user has scrolled down from the top” — 0 shows the TOP of the content, max_scroll_y shows the BOTTOM. Same convention for horizontal: h_scroll_offset = 0 shows the LEFT of the content.

§Virtual rendering

with_viewport_cell(Rc<Cell<Rect>>) publishes the currently-visible content-space rect each layout. Children that want to cull off-viewport work (e.g. painting 10k row labels) read this cell and limit their paint.

Structs§

ScrollBarStyle
Full scrollbar appearance configuration — mirrors egui’s style.spacing.scroll.
ScrollView

Enums§

ScrollBarColor
Which pair of colours is used for the track vs thumb.
ScrollBarKind
Whether the bar reserves layout space (Solid) or floats over content (Floating).
ScrollBarVisibility
How the scrollbar is shown. Matches egui’s ScrollBarVisibility.

Functions§

current_scroll_style
Read the current global scroll-bar style.
current_scroll_visibility
Read the current global scroll-bar visibility policy.
set_scroll_style
Replace the global scroll-bar style. All subsequent ScrollView layouts that don’t have an explicit override pick this up.
set_scroll_visibility
Replace the global scroll-bar visibility policy. Every ScrollView that doesn’t bind its own with_bar_visibility_cell(...) or call with_bar_visibility(...) reads this value on each layout.