Skip to content

Commit aa87581

Browse files
authored
Change CoreWidgets plugin to plugin group. (#20036)
What it says on the tin. :)
1 parent 0ee9377 commit aa87581

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

crates/bevy_core_widgets/src/lib.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ mod core_radio;
2121
mod core_scrollbar;
2222
mod core_slider;
2323

24-
use bevy_app::{App, Plugin};
24+
use bevy_app::{PluginGroup, PluginGroupBuilder};
2525

2626
pub use callback::{Callback, Notify};
2727
pub use core_button::{CoreButton, CoreButtonPlugin};
@@ -36,18 +36,17 @@ pub use core_slider::{
3636
SliderRange, SliderStep, SliderValue, TrackClick,
3737
};
3838

39-
/// A plugin that registers the observers for all of the core widgets. If you don't want to
39+
/// A plugin group that registers the observers for all of the core widgets. If you don't want to
4040
/// use all of the widgets, you can import the individual widget plugins instead.
41-
pub struct CoreWidgetsPlugin;
41+
pub struct CoreWidgetsPlugins;
4242

43-
impl Plugin for CoreWidgetsPlugin {
44-
fn build(&self, app: &mut App) {
45-
app.add_plugins((
46-
CoreButtonPlugin,
47-
CoreCheckboxPlugin,
48-
CoreRadioGroupPlugin,
49-
CoreScrollbarPlugin,
50-
CoreSliderPlugin,
51-
));
43+
impl PluginGroup for CoreWidgetsPlugins {
44+
fn build(self) -> PluginGroupBuilder {
45+
PluginGroupBuilder::start::<Self>()
46+
.add(CoreButtonPlugin)
47+
.add(CoreCheckboxPlugin)
48+
.add(CoreRadioGroupPlugin)
49+
.add(CoreScrollbarPlugin)
50+
.add(CoreSliderPlugin)
5251
}
5352
}

examples/ui/core_widgets.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use bevy::{
44
color::palettes::basic::*,
55
core_widgets::{
66
Callback, CoreButton, CoreCheckbox, CoreRadio, CoreRadioGroup, CoreSlider,
7-
CoreSliderDragState, CoreSliderThumb, CoreWidgetsPlugin, SliderRange, SliderValue,
7+
CoreSliderDragState, CoreSliderThumb, CoreWidgetsPlugins, SliderRange, SliderValue,
88
TrackClick,
99
},
1010
input_focus::{
@@ -21,7 +21,7 @@ fn main() {
2121
App::new()
2222
.add_plugins((
2323
DefaultPlugins,
24-
CoreWidgetsPlugin,
24+
CoreWidgetsPlugins,
2525
InputDispatchPlugin,
2626
TabNavigationPlugin,
2727
))

examples/ui/core_widgets_observers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use bevy::{
44
color::palettes::basic::*,
55
core_widgets::{
6-
Callback, CoreButton, CoreCheckbox, CoreSlider, CoreSliderThumb, CoreWidgetsPlugin,
6+
Callback, CoreButton, CoreCheckbox, CoreSlider, CoreSliderThumb, CoreWidgetsPlugins,
77
SliderRange, SliderValue,
88
},
99
ecs::system::SystemId,
@@ -21,7 +21,7 @@ fn main() {
2121
App::new()
2222
.add_plugins((
2323
DefaultPlugins,
24-
CoreWidgetsPlugin,
24+
CoreWidgetsPlugins,
2525
InputDispatchPlugin,
2626
TabNavigationPlugin,
2727
))

examples/ui/feathers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! This example shows off the various Bevy Feathers widgets.
22
33
use bevy::{
4-
core_widgets::{Callback, CoreRadio, CoreRadioGroup, CoreWidgetsPlugin, SliderStep},
4+
core_widgets::{Callback, CoreRadio, CoreRadioGroup, CoreWidgetsPlugins, SliderStep},
55
feathers::{
66
controls::{
77
button, checkbox, radio, slider, toggle_switch, ButtonProps, ButtonVariant,
@@ -25,7 +25,7 @@ fn main() {
2525
App::new()
2626
.add_plugins((
2727
DefaultPlugins,
28-
CoreWidgetsPlugin,
28+
CoreWidgetsPlugins,
2929
InputDispatchPlugin,
3030
TabNavigationPlugin,
3131
FeathersPlugin,

release-content/release-notes/headless-widgets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Headless Widgets
33
authors: ["@viridia", "@ickshonpe", "@alice-i-cecile"]
4-
pull_requests: [19366, 19584, 19665, 19778, 19803]
4+
pull_requests: [19366, 19584, 19665, 19778, 19803, 20036]
55
---
66

77
Bevy's `Button` and `Interaction` components have been around for a long time. Unfortunately

0 commit comments

Comments
 (0)