From a31fc62f061123da96f477ade916766b3188b098 Mon Sep 17 00:00:00 2001 From: pablo-lua Date: Sun, 8 Oct 2023 11:38:04 -0300 Subject: [PATCH 1/5] Added Deserialize and Serialize traits for struct Style --- crates/bevy_ui/src/ui_node.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index 7b6209c685830..6ad5a21edf36b 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -117,8 +117,8 @@ impl Default for Node { /// - [A Complete Guide To CSS Grid](https://css-tricks.com/snippets/css/complete-guide-grid/) by CSS Tricks. This is detailed guide with illustrations and comprehensive written explanation of the different CSS Grid properties and how they work. /// - [CSS Grid Garden](https://cssgridgarden.com/). An interactive tutorial/game that teaches the essential parts of CSS Grid in a fun engaging way. -#[derive(Component, Clone, PartialEq, Debug, Reflect)] -#[reflect(Component, Default, PartialEq)] +#[derive(Component, Clone, PartialEq, Debug, Deserialize, Serialize,Reflect)] +#[reflect(Component, Default, PartialEq, Deserialize, Serialize)] pub struct Style { /// Which layout algorithm to use when laying out this node's contents: /// - [`Display::Flex`]: Use the Flexbox layout algorithm From 6c9c864680d9fb204449ba4b26f58f67c32fe79e Mon Sep 17 00:00:00 2001 From: pablo-lua Date: Sun, 8 Oct 2023 11:38:31 -0300 Subject: [PATCH 2/5] Added Deserialize and Serialize traits for struct BackgroundColor --- crates/bevy_ui/src/ui_node.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index 6ad5a21edf36b..c3c8a0a9e6494 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -1420,8 +1420,8 @@ pub enum GridPlacementError { /// /// This serves as the "fill" color. /// When combined with [`UiImage`], tints the provided texture. -#[derive(Component, Copy, Clone, Debug, Reflect)] -#[reflect(Component, Default)] +#[derive(Component, Copy, Clone, Debug, Deserialize, Serialize, Reflect)] +#[reflect(Component, Default, Deserialize, Serialize)] pub struct BackgroundColor(pub Color); impl BackgroundColor { From 3cfeb372921fb48737f0fef4956a2944f46fea31 Mon Sep 17 00:00:00 2001 From: pablo-lua Date: Sun, 8 Oct 2023 11:38:45 -0300 Subject: [PATCH 3/5] Added Deserialize and Serialize traits for struct BorderColor --- crates/bevy_ui/src/ui_node.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index c3c8a0a9e6494..90a2604fd7f7c 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -1453,8 +1453,8 @@ pub struct UiTextureAtlasImage { } /// The border color of the UI node. -#[derive(Component, Copy, Clone, Debug, Reflect)] -#[reflect(Component, Default)] +#[derive(Component, Copy, Clone, Debug, Deserialize, Serialize, Reflect)] +#[reflect(Component, Default, Deserialize, Serialize)] pub struct BorderColor(pub Color); impl From for BorderColor { From b0433fe9df92ec9fc85efe473f17076ab4069248 Mon Sep 17 00:00:00 2001 From: pablo-lua Date: Sun, 8 Oct 2023 11:39:02 -0300 Subject: [PATCH 4/5] Added Deserialize and Serialize traits for struct Outline --- crates/bevy_ui/src/ui_node.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index 90a2604fd7f7c..3399a04b74859 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -1473,8 +1473,8 @@ impl Default for BorderColor { } } -#[derive(Component, Copy, Clone, Default, Debug, Reflect)] -#[reflect(Component, Default)] +#[derive(Component, Copy, Clone, Default, Debug, Deserialize, Serialize, Reflect)] +#[reflect(Component, Default, Deserialize, Serialize)] /// The [`Outline`] component adds an outline outside the edge of a UI node. /// Outlines do not take up space in the layout /// From 6167f9099340f781c92826b41d164a4733b63d26 Mon Sep 17 00:00:00 2001 From: pablo-lua Date: Sun, 8 Oct 2023 14:26:51 -0300 Subject: [PATCH 5/5] Code style (CI) correction --- crates/bevy_ui/src/ui_node.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index 3399a04b74859..3a87765fea840 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -117,7 +117,7 @@ impl Default for Node { /// - [A Complete Guide To CSS Grid](https://css-tricks.com/snippets/css/complete-guide-grid/) by CSS Tricks. This is detailed guide with illustrations and comprehensive written explanation of the different CSS Grid properties and how they work. /// - [CSS Grid Garden](https://cssgridgarden.com/). An interactive tutorial/game that teaches the essential parts of CSS Grid in a fun engaging way. -#[derive(Component, Clone, PartialEq, Debug, Deserialize, Serialize,Reflect)] +#[derive(Component, Clone, PartialEq, Debug, Deserialize, Serialize, Reflect)] #[reflect(Component, Default, PartialEq, Deserialize, Serialize)] pub struct Style { /// Which layout algorithm to use when laying out this node's contents: