Skip to content

Commit 82acdfd

Browse files
authored
derive Clone and Copy for newer interaction_states unit structs (#22115)
# Objective - derive `Clone` and `Copy` for the newer unit structs in `interaction_states`, this is useful for frameworks that are generic over `Component + Clone/Copy` and is also the status quo for the existing `InteractionDisabled` component defined a few lines above ## Solution - derive `Clone` and `Copy` for `Pressed`, `Checkable`, and `Checked`
1 parent 86224b5 commit 82acdfd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/bevy_ui/src/interaction_states.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ pub(crate) fn on_remove_disabled(
3737

3838
/// Component that indicates whether a button or widget is currently in a pressed or "held down"
3939
/// state.
40-
#[derive(Component, Default, Debug)]
40+
#[derive(Component, Debug, Clone, Copy, Default)]
4141
pub struct Pressed;
4242

4343
/// Component that indicates that a widget can be checked.
44-
#[derive(Component, Default, Debug)]
44+
#[derive(Component, Debug, Clone, Copy, Default)]
4545
pub struct Checkable;
4646

4747
/// Component that indicates whether a checkbox or radio button is in a checked state.
48-
#[derive(Component, Default, Debug)]
48+
#[derive(Component, Debug, Clone, Copy, Default)]
4949
pub struct Checked;
5050

5151
pub(crate) fn on_add_checkable(add: On<Add, Checked>, mut world: DeferredWorld) {

0 commit comments

Comments
 (0)