Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / COLLECTIONS AND INTERACTION
Scrollbar
A reusable scrollbar for any content measured by ScrollState.
Vertical bars occupy the area's first column; horizontal bars occupy its first row. Route drag/up events to the captured bar even when the pointer leaves its track.
Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.
Members on this page
Feature guides and release status
Scrollbar
struct ScrollbarConforms to: Widget.
A reusable scrollbar for any content measured by ScrollState.
Vertical bars occupy the area's first column; horizontal bars occupy its first row. Route drag/up events to the captured bar even when the pointer leaves its track.
Source · Scrollbar.swift:12state
var state: ScrollStateA public field of this type. Its value type and mutability are shown in the declaration.
Source · Scrollbar.swift:13direction
var direction: DirectionThe horizontal or vertical allocation axis.
Source · Scrollbar.swift:14trackStyle
var trackStyle: StyleA public field of this type. Its value type and mutability are shown in the declaration.
Source · Scrollbar.swift:15thumbStyle
var thumbStyle: StyleA public field of this type. Its value type and mutability are shown in the declaration.
Source · Scrollbar.swift:16hidesWhenUnneeded
var hidesWhenUnneeded: BoolA public field of this type. Its value type and mutability are shown in the declaration.
Source · Scrollbar.swift:17thumbSymbol
var thumbSymbol: StringInvalid or non-single-cell symbols fall back to the default symbol.
Source · Scrollbar.swift:19trackSymbol
var trackSymbol: String?A public field of this type. Its value type and mutability are shown in the declaration.
Source · Scrollbar.swift:20startSymbol
var startSymbol: String?A public field of this type. Its value type and mutability are shown in the declaration.
Source · Scrollbar.swift:21endSymbol
var endSymbol: String?A public field of this type. Its value type and mutability are shown in the declaration.
Source · Scrollbar.swift:22init(_:direction:)
init(_ state: ScrollState, direction: Direction = .vertical)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (2)
state- Argument type and any default are shown in the declaration; see the behavior notes above.
direction- Argument type and any default are shown in the declaration; see the behavior notes above.
trackArea(in:)
func trackArea(in area: Rect) -> RectDraggable track, excluding configured endpoint cells.
Parameters (1)
in- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns Rect.
thumbRange(length:)
func thumbRange(length: Int) -> Range<Int>Thumb cells relative to the start of the track.
Parameters (1)
length- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns Range<Int>.
render(in:buffer:)
func render(in area: Rect, buffer: inout Buffer)Paints this widget into the assigned terminal-cell rectangle. Application code owns state, input routing, and terminal lifetime.
Parameters (2)
in- Argument type and any default are shown in the declaration; see the behavior notes above.
buffer- Mutable destination cell grid.
handle(_:in:state:drag:)
@discardableResult func handle(_ mouse: MouseEvent, in area: Rect, state: inout ScrollState, drag: inout ScrollbarDrag?) -> BoolTrack clicks page; thumb drags preserve the pointer's grab position; wheel events scroll.
Parameters (4)
mouse- Mouse action and terminal-cell position.
in- Argument type and any default are shown in the declaration; see the behavior notes above.
state- Argument type and any default are shown in the declaration; see the behavior notes above.
drag- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns Bool.