Skip to main content

Module scrollbar

Module scrollbar 

Source
Expand description

Scrollbar geometry computation — single source of truth for the layout solver.

Provides ScrollbarRequirements (whether scrollbars are needed and how much space they reserve) and ScrollbarGeometry (track, thumb, and button rects).

The main entry point is compute_scrollbar_geometry, whose output is consumed by:

  • Display list painting (paint_scrollbars)
  • GPU transform updates (update_scrollbar_transforms)
  • Hit-testing (hit_test_component)
  • Drag delta conversion (handle_scrollbar_drag)

Structs§

ScrollbarGeometry
Single source of truth for scrollbar geometry.
ScrollbarRequirements
Information about scrollbar requirements and dimensions

Functions§

compute_scrollbar_geometry
Compute scrollbar geometry for one axis.
compute_scrollbar_geometry_with_button_size
Like compute_scrollbar_geometry but allows overriding the button size. Pass button_size = 0.0 for macOS-style overlay scrollbars (no arrow buttons).