pub struct Scrollbar {
pub id: WidgetId,
pub vertical: bool,
pub thumb: Rect,
pub track_start: f32,
pub track_len: f32,
pub thumb_len: f32,
pub max: f32,
pub reverse: bool,
pub opacity: f32,
pub reach: Rect,
pub interactive: bool,
}Expand description
A scrollbar thumb (for hit-testing a drag).
Fields§
§id: WidgetIdThe scrollable area the bar belongs to.
vertical: boolWhether the bar runs vertically; otherwise it is horizontal.
thumb: RectThe thumb’s rectangle, in absolute coordinates.
track_start: f32Start and length of the track, along the axis.
track_len: f32The track’s length along the axis.
thumb_len: f32The thumb’s length along the axis.
max: f32Offset maximal correspondant.
reverse: boolThe offsets of a reversed axis run the other way along the track: offset 0
is the far end, so the thumb rests there and a drag towards the start raises the
number. See Scrollable::reverse_y.
opacity: f32How present the bar is, 0.0..=1.0. A bar at zero is painted by nothing and
cannot be grabbed — but it is still here, because a mouse that comes near it
brings it back.
reach: RectThe rectangle a mouse has to be inside for the bar to notice it: the track,
widened to take in a tap target’s worth of room around the thumb. The reference
reaches out like this on purpose (scrollbar.dart:762) — a bar 8 pixels wide,
resting at a tenth of an opacity, is not something a hand aims at precisely.
interactive: boolWhether a pointer can wake and drag it; not under an Android theme, where the bar only shows where the page is (milestone 617).