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

UI component bundles derive clone #390

Merged
merged 7 commits into from
Aug 29, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion crates/bevy_render/src/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub enum RenderCommand {
}

/// A component that indicates how to draw an entity.
#[derive(Properties)]
#[derive(Properties, Clone)]
pub struct Draw {
pub is_visible: bool,
pub is_transparent: bool,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/pipeline/render_pipelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl RenderPipeline {
}
}

#[derive(Properties)]
#[derive(Properties, Clone)]
pub struct RenderPipelines {
pub pipelines: Vec<RenderPipeline>,
#[property(ignore)]
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_text/src/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use bevy_render::{
};
use bevy_sprite::{TextureAtlas, TextureAtlasSprite};

#[derive(Clone)]
pub struct TextStyle {
pub font_size: f32,
pub color: Color,
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_ui/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use bevy_transform::{
prelude::{Rotation, Scale, Transform, Translation},
};

#[derive(Bundle)]
#[derive(Bundle, Clone)]
pub struct NodeComponents {
pub node: Node,
pub style: Style,
Expand Down Expand Up @@ -62,7 +62,7 @@ impl Default for NodeComponents {
}
}

#[derive(Bundle)]
#[derive(Bundle, Clone)]
pub struct ImageComponents {
pub node: Node,
pub style: Style,
Expand Down Expand Up @@ -110,7 +110,7 @@ impl Default for ImageComponents {
}
}

#[derive(Bundle)]
#[derive(Bundle, Clone)]
pub struct TextComponents {
pub node: Node,
pub style: Style,
Expand Down Expand Up @@ -140,7 +140,7 @@ impl Default for TextComponents {
}
}

#[derive(Bundle)]
#[derive(Bundle, Clone)]
pub struct ButtonComponents {
pub node: Node,
pub button: Button,
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_ui/src/widget/button.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#[derive(Clone)]
pub struct Button;
1 change: 1 addition & 0 deletions crates/bevy_ui/src/widget/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use bevy_math::Size;
use bevy_render::texture::Texture;
use bevy_sprite::ColorMaterial;

#[derive(Clone)]
pub enum Image {
KeepAspect,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ui/src/widget/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use bevy_sprite::TextureAtlas;
use bevy_text::{DrawableText, Font, FontAtlasSet, TextStyle};
use bevy_transform::prelude::Transform;

#[derive(Default)]
#[derive(Default, Clone)]
pub struct Text {
pub value: String,
pub font: Handle<Font>,
Expand Down