Skip to content

FeathersSlider / bevy_ui_widgets/slider fixes#24905

Open
gagnus wants to merge 2 commits into
bevyengine:mainfrom
gagnus:feathers-slider-fixes
Open

FeathersSlider / bevy_ui_widgets/slider fixes#24905
gagnus wants to merge 2 commits into
bevyengine:mainfrom
gagnus:feathers-slider-fixes

Conversation

@gagnus

@gagnus gagnus commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

: Removed value from FeathersSliderProps as it doesn't exist in other controls (use SliderValue component instead) and made SliderPrecision be correctly optional as it is in underlying UI widget rather than silently not updating sliders if not present, in underlying UI widget only send ValueChange if value genuinely changes (matches other controls) rather than every time a SetSliderValue is added

note: slider may end up deprecated in favour of number input, but thought it best to leave it in working state

Objective

  • Working way through feathers constructing minimal UIs from the controls I noticed some differences between the slider and other controls (such as FeathersCheckbox) that would confuse users.

Testing

  • Feathers Gallery and local testing

Showcase

Missing SliderPrecision

(
    @FeathersSlider {
        @min: 0.0,
        @max: 1.0,
    }
    on(slider_self_update)
    on(|change: On<ValueChange<f32>>, mut values: ResMut<TestValues>| {
        info!("value changed {}", change.value);
    })
)

Silently failed to update the slider, now it works.

value property (note: breaking change)

@FeathersSlider {
    @min: 0.0,
    @max: 1.0,
    @value: 0.5,
}

The above is different from other controls which use a component for value

@FeathersSlider {
    @min: 0.0,
    @max: 1.0,
}
SliderValue(0.5)

Is the correct way of setting initial value

SetSliderValue

commands.trigger(SetSliderValue {
     entity,
     change: some_value,
});

Would trigger ValueChange every time, even when some_value is the same as the existing value. Now it doesn't. This is the same as SetChecked

…ps as it doesn't exist in other controls (use SliderValue instead) and made SliderPrecision be correctly optional rather than silently not updating sliders if not present, in underlying UI widget only send ValueChange if value genuinely changes (matches other controls) rather than every time a SetSliderValue is added
@JosephLassuy

Copy link
Copy Markdown

This seems like a great simple change!

@viridia viridia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this.

@JosephLassuy JosephLassuy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants