Change CoreWidgets plugin to plugin group. (#20036)
What it says on the tin. :)
This commit is contained in:
parent
0ee937784e
commit
aa87581cce
@ -21,7 +21,7 @@ mod core_radio;
|
|||||||
mod core_scrollbar;
|
mod core_scrollbar;
|
||||||
mod core_slider;
|
mod core_slider;
|
||||||
|
|
||||||
use bevy_app::{App, Plugin};
|
use bevy_app::{PluginGroup, PluginGroupBuilder};
|
||||||
|
|
||||||
pub use callback::{Callback, Notify};
|
pub use callback::{Callback, Notify};
|
||||||
pub use core_button::{CoreButton, CoreButtonPlugin};
|
pub use core_button::{CoreButton, CoreButtonPlugin};
|
||||||
@ -36,18 +36,17 @@ pub use core_slider::{
|
|||||||
SliderRange, SliderStep, SliderValue, TrackClick,
|
SliderRange, SliderStep, SliderValue, TrackClick,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A plugin that registers the observers for all of the core widgets. If you don't want to
|
/// A plugin group that registers the observers for all of the core widgets. If you don't want to
|
||||||
/// use all of the widgets, you can import the individual widget plugins instead.
|
/// use all of the widgets, you can import the individual widget plugins instead.
|
||||||
pub struct CoreWidgetsPlugin;
|
pub struct CoreWidgetsPlugins;
|
||||||
|
|
||||||
impl Plugin for CoreWidgetsPlugin {
|
impl PluginGroup for CoreWidgetsPlugins {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(self) -> PluginGroupBuilder {
|
||||||
app.add_plugins((
|
PluginGroupBuilder::start::<Self>()
|
||||||
CoreButtonPlugin,
|
.add(CoreButtonPlugin)
|
||||||
CoreCheckboxPlugin,
|
.add(CoreCheckboxPlugin)
|
||||||
CoreRadioGroupPlugin,
|
.add(CoreRadioGroupPlugin)
|
||||||
CoreScrollbarPlugin,
|
.add(CoreScrollbarPlugin)
|
||||||
CoreSliderPlugin,
|
.add(CoreSliderPlugin)
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ use bevy::{
|
|||||||
color::palettes::basic::*,
|
color::palettes::basic::*,
|
||||||
core_widgets::{
|
core_widgets::{
|
||||||
Callback, CoreButton, CoreCheckbox, CoreRadio, CoreRadioGroup, CoreSlider,
|
Callback, CoreButton, CoreCheckbox, CoreRadio, CoreRadioGroup, CoreSlider,
|
||||||
CoreSliderDragState, CoreSliderThumb, CoreWidgetsPlugin, SliderRange, SliderValue,
|
CoreSliderDragState, CoreSliderThumb, CoreWidgetsPlugins, SliderRange, SliderValue,
|
||||||
TrackClick,
|
TrackClick,
|
||||||
},
|
},
|
||||||
input_focus::{
|
input_focus::{
|
||||||
@ -21,7 +21,7 @@ fn main() {
|
|||||||
App::new()
|
App::new()
|
||||||
.add_plugins((
|
.add_plugins((
|
||||||
DefaultPlugins,
|
DefaultPlugins,
|
||||||
CoreWidgetsPlugin,
|
CoreWidgetsPlugins,
|
||||||
InputDispatchPlugin,
|
InputDispatchPlugin,
|
||||||
TabNavigationPlugin,
|
TabNavigationPlugin,
|
||||||
))
|
))
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
use bevy::{
|
use bevy::{
|
||||||
color::palettes::basic::*,
|
color::palettes::basic::*,
|
||||||
core_widgets::{
|
core_widgets::{
|
||||||
Callback, CoreButton, CoreCheckbox, CoreSlider, CoreSliderThumb, CoreWidgetsPlugin,
|
Callback, CoreButton, CoreCheckbox, CoreSlider, CoreSliderThumb, CoreWidgetsPlugins,
|
||||||
SliderRange, SliderValue,
|
SliderRange, SliderValue,
|
||||||
},
|
},
|
||||||
ecs::system::SystemId,
|
ecs::system::SystemId,
|
||||||
@ -21,7 +21,7 @@ fn main() {
|
|||||||
App::new()
|
App::new()
|
||||||
.add_plugins((
|
.add_plugins((
|
||||||
DefaultPlugins,
|
DefaultPlugins,
|
||||||
CoreWidgetsPlugin,
|
CoreWidgetsPlugins,
|
||||||
InputDispatchPlugin,
|
InputDispatchPlugin,
|
||||||
TabNavigationPlugin,
|
TabNavigationPlugin,
|
||||||
))
|
))
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//! This example shows off the various Bevy Feathers widgets.
|
//! This example shows off the various Bevy Feathers widgets.
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
core_widgets::{Callback, CoreRadio, CoreRadioGroup, CoreWidgetsPlugin, SliderStep},
|
core_widgets::{Callback, CoreRadio, CoreRadioGroup, CoreWidgetsPlugins, SliderStep},
|
||||||
feathers::{
|
feathers::{
|
||||||
controls::{
|
controls::{
|
||||||
button, checkbox, radio, slider, toggle_switch, ButtonProps, ButtonVariant,
|
button, checkbox, radio, slider, toggle_switch, ButtonProps, ButtonVariant,
|
||||||
@ -25,7 +25,7 @@ fn main() {
|
|||||||
App::new()
|
App::new()
|
||||||
.add_plugins((
|
.add_plugins((
|
||||||
DefaultPlugins,
|
DefaultPlugins,
|
||||||
CoreWidgetsPlugin,
|
CoreWidgetsPlugins,
|
||||||
InputDispatchPlugin,
|
InputDispatchPlugin,
|
||||||
TabNavigationPlugin,
|
TabNavigationPlugin,
|
||||||
FeathersPlugin,
|
FeathersPlugin,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: Headless Widgets
|
title: Headless Widgets
|
||||||
authors: ["@viridia", "@ickshonpe", "@alice-i-cecile"]
|
authors: ["@viridia", "@ickshonpe", "@alice-i-cecile"]
|
||||||
pull_requests: [19366, 19584, 19665, 19778, 19803]
|
pull_requests: [19366, 19584, 19665, 19778, 19803, 20036]
|
||||||
---
|
---
|
||||||
|
|
||||||
Bevy's `Button` and `Interaction` components have been around for a long time. Unfortunately
|
Bevy's `Button` and `Interaction` components have been around for a long time. Unfortunately
|
||||||
|
Loading…
Reference in New Issue
Block a user