Skip to main content

update_scrollbars

Function update_scrollbars 

Source
pub fn update_scrollbars(
    commands: Commands<'_, '_>,
    tick: Res<'_, Tick>,
    anim: Res<'_, AnimationsActive>,
    pointer: Res<'_, PointerState>,
    presses: MessageReader<'_, '_, PointerPressed>,
    releases: MessageReader<'_, '_, PointerReleased>,
    keys: MessageReader<'_, '_, KeyPressed>,
    interaction: ResMut<'_, ScrollbarInteraction>,
    frame_dirty: ResMut<'_, FrameDirty>,
    parents: Query<'_, '_, &ChildOf>,
    children_q: Query<'_, '_, (&ChildOf, &Transform)>,
    bare: Query<'_, '_, Entity, (With<Scroll>, Without<ScrollbarState>)>,
    styles: Query<'_, '_, &ScrollbarStyle>,
    scrolls: Query<'_, '_, (Entity, &Transform, &mut Scroll, &mut ScrollOffset, &mut ScrollbarState)>,
)
Expand description

Pointer FSM + fade driver for overlay scrollbars. Runs in TickStage::Systems strictly before lumen_input::hit_test so the ScrollbarInteraction resource the hit-test consults reflects this tick’s pointer position.

All visual + timing knobs (thickness, minimum thumb, fade delay / ramp) resolve through ScrollbarStyle - CSS scrollbar-color / scrollbar-width per container, with the component Default as the no-stylesheet fallback - so the FSM’s hit regions always match the styled paint.