Crate rat_scrolled

Crate rat_scrolled 

Source
Expand description

semver stable crates.io Documentation License License

This crate is a part of rat-salsa.

For examples see rat-scrolled GitHub

§Scroll

Scroll adds support for widgets that want to scroll their content.

Scroll works analogous to Block, it can be set on the widget struct where it is supported. The widget can decide which scrolling it can do, horizontal vertical or both.

§Adding scroll to a widget

  • Add Scroll to the widget struct.
  • Use ScrollArea for the layout and rendering of the combination of Block+Scroll+Scroll your widget supports.
  • Add ScrollState to the widget state struct.
  • Use a ScrollAreaState for event-handling.

Examples

§For what?

This is for widgets that handle their scrolling internally. They use ScrollState::offset to manage what they have to render. And they set ScrollState::page_len and ScrollState::max_offset to get a correct scrollbar displayed.

Widgets that don’t want to do this can be rendered using View or Clipper.

Modules§

event

Structs§

Scroll
Scroll widget.
ScrollArea
Utility widget for rendering a combination of a Block and one or two Scroll(bars). Any of these can be None.
ScrollAreaState
Temporary state for ScrollArea.
ScrollState
Scroll state.
ScrollStyle
Collected styles for the Scroll.
ScrollSymbols
Scrollbar Symbol Set

Enums§

ScrollbarPolicy
Behaviour of the scrollbar.

Constants§

SCROLLBAR_DOUBLE_HORIZONTAL
SCROLLBAR_DOUBLE_VERTICAL
SCROLLBAR_HORIZONTAL
SCROLLBAR_VERTICAL