Skip to content

Commit

Permalink
Update color defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGVSV committed Jul 28, 2023
1 parent c395e52 commit d6c35d6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ pub(crate) fn register_custom_schematics(app: &mut App) {
.register_type::<TextBundle>();
}

fn transparent_background_color() -> bevy_impls::ui::BackgroundColorInput {
bevy_impls::ui::BackgroundColorInput(ProtoColor::None)
}

fn transparent_border_color() -> bevy_impls::ui::BorderColorInput {
bevy_impls::ui::BorderColorInput(ProtoColor::None)
}

/// A [`Schematic`] implementation of [`TransformBundle`].
///
/// [`TransformBundle`]: bevy::prelude::TransformBundle
Expand Down Expand Up @@ -523,7 +531,7 @@ pub struct ButtonBundle {
pub focus_policy: bevy_impls::ui::FocusPolicyInput,
#[reflect(default)]
pub background_color: bevy_impls::ui::BackgroundColorInput,
#[reflect(default)]
#[reflect(default = "transparent_border_color")]
pub border_color: bevy_impls::ui::BorderColorInput,
#[reflect(default)]
pub image: bevy_impls::ui::UiImageInput,
Expand Down Expand Up @@ -687,10 +695,6 @@ pub struct TextBundle {
pub background_color: bevy_impls::ui::BackgroundColorInput,
}

fn transparent_background_color() -> bevy_impls::ui::BackgroundColorInput {
bevy_impls::ui::BackgroundColorInput(ProtoColor::None)
}

#[cfg(feature = "bevy_ui")]
impl FromSchematicInput<TextBundle> for bevy::ui::node_bundles::TextBundle {
fn from_input(input: TextBundle, context: &mut SchematicContext) -> Self {
Expand Down

0 comments on commit d6c35d6

Please sign in to comment.