//! This crate provides a set of standard widgets for Bevy UI, such as buttons, checkboxes, and sliders.1//! These widgets have no inherent styling, it's the responsibility of the user to add styling2//! appropriate for their game or application.3//!4//! ## Warning: Experimental5//!6//! This crate is currently experimental and under active development.7//! The API is likely to change substantially: be prepared to migrate your code.8//!9//! We are actively seeking feedback on the design and implementation of this crate, so please10//! file issues or create PRs if you have any comments or suggestions.11//!12//! ## State Management13//!14//! Most of the widgets use external state management: this means that the widgets do not15//! automatically update their own internal state, but instead rely on the app to update the widget16//! state (as well as any other related game state) in response to a change event emitted by the17//! widget. The primary motivation for this is to avoid two-way data binding in scenarios where the18//! user interface is showing a live view of dynamic data coming from deeper within the game engine.1920mod button;21mod callback;22mod checkbox;23mod radio;24mod scrollbar;25mod slider;2627pub use button::*;28pub use callback::*;29pub use checkbox::*;30pub use radio::*;31pub use scrollbar::*;32pub use slider::*;3334use bevy_app::{PluginGroup, PluginGroupBuilder};35use bevy_ecs::entity::Entity;3637/// A plugin group that registers the observers for all of the widgets in this crate. If you don't want to38/// use all of the widgets, you can import the individual widget plugins instead.39pub struct UiWidgetsPlugins;4041impl PluginGroup for UiWidgetsPlugins {42fn build(self) -> PluginGroupBuilder {43PluginGroupBuilder::start::<Self>()44.add(ButtonPlugin)45.add(CheckboxPlugin)46.add(RadioGroupPlugin)47.add(ScrollbarPlugin)48.add(SliderPlugin)49}50}5152/// Notification sent by a button or menu item.53#[derive(Copy, Clone, Debug, PartialEq)]54pub struct Activate(pub Entity);5556/// Notification sent by a widget that edits a scalar value.57#[derive(Copy, Clone, Debug, PartialEq)]58pub struct ValueChange<T> {59/// The id of the widget that produced this value.60pub source: Entity,61/// The new value.62pub value: T,63}646566