Skip to main content

adjust_slider_on_wheel

Function adjust_slider_on_wheel 

Source
pub fn adjust_slider_on_wheel(
    wheels: MessageReader<'_, '_, MouseWheel>,
    hovered: Query<'_, '_, Entity, With<Hovered>>,
    parents: Query<'_, '_, &ChildOf>,
    sliders: Query<'_, '_, &mut SliderValue>,
    out: MessageWriter<'_, SliderChanged>,
)
Expand description

Wheel over a hovered <slider> (or its thumb child) nudges the value by SliderValue::step_size per notch - wheel-up (a negative delta, away from the user) increases, matching Qt’s QSlider::wheelEvent. The wheel is consumed by the slider: lumen_primitives::scroll::accumulate_wheel stands down whenever a slider sits on the hovered entity’s ancestor chain, so adjusting a slider never also scrolls an ancestor scroll container.