Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/bevy_feathers/src/controls/color_slider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ fn update_slider_pos(
q_children: Query<&Children>,
mut q_slider_thumb: Query<&mut Node, With<ColorSliderThumb>>,
) {
for (slider_ent, value, range) in q_sliders.iter_mut() {
for (slider_ent, SliderValue(value), range) in q_sliders.iter_mut() {
for child in q_children.iter_descendants(slider_ent) {
if let Ok(mut thumb_node) = q_slider_thumb.get_mut(child) {
thumb_node.left = Val::Percent(range.thumb_position(value.0) * 100.0);
thumb_node.left = Val::Percent(range.thumb_position(*value) * 100.0);
}
}
}
Expand Down
11 changes: 7 additions & 4 deletions examples/ui/feathers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,14 @@ fn demo_root() -> impl Scene {

fn update_colors(
colors: Res<DemoWidgetStates>,
mut sliders: Query<(Entity, &ColorSlider, &mut SliderBaseColor)>,
swatches: Query<(&SwatchType, &Children), With<ColorSwatch>>,
mut sliders: Query<(Entity, Ref<ColorSlider>, &mut SliderBaseColor)>,
swatches: Query<(Ref<SwatchType>, &Children), With<ColorSwatch>>,
mut commands: Commands,
) {
if colors.is_changed() {
// Check to see if sliders or swatches were added after resource has changed.
let sliders_added = sliders.iter().any(|(_, slider, _)| slider.is_added());
let swatches_added = swatches.iter().any(|(swatch, _)| swatch.is_added());
if colors.is_changed() || sliders_added || swatches_added {
for (slider_ent, slider, mut base) in sliders.iter_mut() {
match slider.channel {
ColorChannel::Red => {
Expand Down Expand Up @@ -423,7 +426,7 @@ fn update_colors(
for (swatch_type, children) in swatches.iter() {
commands
.entity(children[0])
.insert(BackgroundColor(match swatch_type {
.insert(BackgroundColor(match *swatch_type {
SwatchType::Rgb => colors.rgb_color.into(),
SwatchType::Hsl => colors.hsl_color.into(),
}));
Expand Down