diff --git a/CHANGELOG.md b/CHANGELOG.md index 318f39b..ae341e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## [0.4.0] + +## Changed + +- Updated to Bevy 0.16 + ## [0.3.2] ## Added diff --git a/Cargo.toml b/Cargo.toml index 937183e..b770f56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_simple_scroll_view" -version = "0.3.2" +version = "0.4.0" edition = "2021" exclude = [".github/", "wasm/", "record.gif"] categories = ["game-development", "gui"] @@ -11,17 +11,17 @@ license = "MIT OR Apache-2.0" description = "Simple to use plugin implementing ScrollView into Bevy engine." [dependencies.bevy] -version = "0.15" +version = "0.16" default-features = false features = ["bevy_ui", "bevy_asset", "bevy_text"] [dev-dependencies.bevy] -version = "0.15" +version = "0.16" default-features = true [features] default = [] -extra_logs = [] +extra_logs = ["bevy/bevy_log"] [lints.rust] missing_docs = "warn" diff --git a/README.md b/README.md index bd0540c..62dc5c4 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ Please keep PRs small and scoped to a single feature or fix. Bevy version | crate version --- | --- +0.16 | 0.4 0.15 | 0.3 0.14 | 0.2 0.13 | 0.1 diff --git a/examples/simple.rs b/examples/simple.rs index 937729b..f69e5d9 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -1,6 +1,6 @@ #![allow(missing_docs)] -use bevy::picking::events::{Pointer, Up}; +use bevy::picking::events::{Pointer, Released}; use bevy::prelude::*; use bevy_simple_scroll_view::*; @@ -22,7 +22,7 @@ fn setup(mut commands: Commands) { justify_content: JustifyContent::Center, min_width: Val::Px(200.0), margin: UiRect::all(Val::Px(10.0)), - border: UiRect::all(Val::Px(3.0)), + border: UiRect::all(Val::Px(5.0)), padding: UiRect::all(Val::Px(15.0)), ..default() }; @@ -75,10 +75,10 @@ fn setup(mut commands: Commands) { }); } -fn scroll_to_top(_t: Trigger>, mut scroll: Single<&mut ScrollableContent>) { +fn scroll_to_top(_t: Trigger>, mut scroll: Single<&mut ScrollableContent>) { scroll.scroll_to_top(); } -fn scroll_to_bottom(_t: Trigger>, mut scroll: Single<&mut ScrollableContent>) { +fn scroll_to_bottom(_t: Trigger>, mut scroll: Single<&mut ScrollableContent>) { scroll.scroll_to_bottom(); } diff --git a/src/lib.rs b/src/lib.rs index 4183bd4..8dceba3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,7 +39,7 @@ impl Plugin for ScrollViewPlugin { /// Root component of scroll, it should have clipped style. #[derive(Component, Debug, Reflect)] -#[require(Interaction, Node(scroll_view_node))] +#[require(Interaction, Node = scroll_view_node())] pub struct ScrollView { /// Field which control speed of the scrolling. /// Could be negative number to implement invert scroll @@ -57,7 +57,7 @@ impl Default for ScrollView { /// Component containing offset value of the scroll container to the parent. /// It is possible to update the field `pos_y` manually to move scrollview to desired location. #[derive(Component, Debug, Reflect, Default)] -#[require(Node(scroll_content_node))] +#[require(Node = scroll_content_node())] pub struct ScrollableContent { /// Scroll container offset to the `ScrollView`. pub pos_y: f32, @@ -140,7 +140,7 @@ fn input_mouse_pressed_move( if interaction != Interaction::Pressed { continue; } - for &child in children.iter() { + for child in children.iter() { let Ok(mut scroll) = content_q.get_mut(child) else { continue; }; @@ -156,7 +156,7 @@ fn update_size( ) { for (children, scroll_view_node) in q.iter_mut() { let container_height = scroll_view_node.size().y * scroll_view_node.inverse_scale_factor(); - for &child in children.iter() { + for child in children.iter() { let Ok((mut scroll, node)) = content_q.get_mut(child) else { continue; }; @@ -186,7 +186,7 @@ fn input_touch_pressed_move( if interaction != Interaction::Pressed { continue; } - for &child in children.iter() { + for child in children.iter() { let Ok(mut scroll) = content_q.get_mut(child) else { continue; }; @@ -217,7 +217,7 @@ fn scroll_events( #[cfg(feature = "extra_logs")] info!("Scroolling by {:#?}: {} movement", ev.unit, y); - for &child in children.iter() { + for child in children.iter() { let Ok(mut scroll) = content_q.get_mut(child) else { continue; };