Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Remove needless manual default impl of ButtonBundle #6970

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions crates/bevy_ui/src/node_bundles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub struct ImageBundle {
pub calculated_size: CalculatedSize,
/// The background color, which serves as a "fill" for this node
///
/// When combined with `UiImage`, tints the provided image.
/// Combines with `UiImage` to tint the provided image.
Copy link
Contributor Author

@nicopap nicopap Dec 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UiImage need a BackgroundColor, otherwise it won't render, I felt the previous phrasing implies it wasn't the case, noting that this is documentation on a field of ImageBundle

pub background_color: BackgroundColor,
/// The image of the node
pub image: UiImage,
Expand Down Expand Up @@ -178,7 +178,7 @@ impl Default for TextBundle {
}

/// A UI node that is a button
#[derive(Bundle, Clone, Debug)]
#[derive(Bundle, Clone, Debug, Default)]
pub struct ButtonBundle {
/// Describes the size of the node
pub node: Node,
Expand Down Expand Up @@ -213,22 +213,3 @@ pub struct ButtonBundle {
/// Indicates the depth at which the node should appear in the UI
pub z_index: ZIndex,
}

impl Default for ButtonBundle {
fn default() -> Self {
ButtonBundle {
button: Button,
interaction: Default::default(),
focus_policy: Default::default(),
node: Default::default(),
style: Default::default(),
background_color: Default::default(),
image: Default::default(),
transform: Default::default(),
global_transform: Default::default(),
visibility: Default::default(),
computed_visibility: Default::default(),
z_index: Default::default(),
}
}
}