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] - Rename UiColor to BackgroundColor #6087

Closed
wants to merge 3 commits into from

Conversation

alice-i-cecile
Copy link
Member

@alice-i-cecile alice-i-cecile commented Sep 24, 2022

Objective

Fixes #6078. The UiColor component is unhelpfully named: it is unclear, ambiguous with border color and

Solution

Rename the UiColor component (and associated fields) to BackgroundColor / background_colorl.

Migration Guide

UiColor has been renamed to BackgroundColor. This change affects NodeBundle, ButtonBundle and ImageBundle. In addition, the corresponding field on ExtractedUiNode has been renamed to background_color for consistency.

@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Sep 24, 2022
Copy link
Contributor

@Weibye Weibye left a comment

Choose a reason for hiding this comment

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

Great! This makes more sense :)

Copy link
Contributor

@BorisBoutillier BorisBoutillier left a comment

Choose a reason for hiding this comment

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

That cliffhander of an Objective: 'with border color and '..... See you in next episode :)

I think doc string should be updated.

I wonder if FillColor would be better than Fill.

Fill seems better in constructor ( as you will pass a Color just next).
but FillColor seems better in queries. Query< ( Interaction, &mut Fill)> seems less self-explanatory than Query<(Interaction, &mut FillColor)>
Can't really decide myself, so I'll accept both :)

crates/bevy_ui/src/entity.rs Outdated Show resolved Hide resolved
crates/bevy_ui/src/entity.rs Outdated Show resolved Hide resolved
crates/bevy_ui/src/entity.rs Outdated Show resolved Hide resolved
crates/bevy_ui/src/ui_node.rs Outdated Show resolved Hide resolved
@afonsolage
Copy link
Contributor

I feel (no pun intended) that FillColor fits better with being explicit about what it does, but since we are kinda following a web-like standard (with FlexBox), then BackgroundColor is a better fit.

In the future we may add other ui components like BorderColor, TextColor (if we decided to split TextStyle component) and so on, so Fill is a bit generic IMO.

@mockersf
Copy link
Member

BackgroundColor would fit much better in my opinion, it's more descriptive and the standard

@alice-i-cecile
Copy link
Member Author

Yep, I'm happy to go with BackgroundColor and I'll update the doc strings too :)

@alice-i-cecile alice-i-cecile changed the title Rename UiColor to Fill Rename UiColor to BackgroundColor Sep 24, 2022
@mockersf mockersf added the M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Sep 25, 2022
Copy link
Member

@mockersf mockersf left a comment

Choose a reason for hiding this comment

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

don't forget to rename also in the PR description 🙂

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Sep 25, 2022
@alice-i-cecile
Copy link
Member Author

I got the title but missed the description 😅

bors r+

bors bot pushed a commit that referenced this pull request Sep 25, 2022
# Objective

Fixes #6078. The `UiColor` component is unhelpfully named: it is unclear, ambiguous with border color and 

## Solution

Rename the `UiColor` component (and associated fields) to `BackgroundColor` / `background_colorl`.

## Migration Guide

`UiColor` has been renamed to `BackgroundColor`. This change affects `NodeBundle`, `ButtonBundle` and `ImageBundle`. In addition, the corresponding field on `ExtractedUiNode` has been renamed to `background_color` for consistency.
@bors bors bot changed the title Rename UiColor to BackgroundColor [Merged by Bors] - Rename UiColor to BackgroundColor Sep 25, 2022
@bors bors bot closed this Sep 25, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 19, 2022
# Objective

Fixes bevyengine#6078. The `UiColor` component is unhelpfully named: it is unclear, ambiguous with border color and 

## Solution

Rename the `UiColor` component (and associated fields) to `BackgroundColor` / `background_colorl`.

## Migration Guide

`UiColor` has been renamed to `BackgroundColor`. This change affects `NodeBundle`, `ButtonBundle` and `ImageBundle`. In addition, the corresponding field on `ExtractedUiNode` has been renamed to `background_color` for consistency.
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
# Objective

Fixes bevyengine#6078. The `UiColor` component is unhelpfully named: it is unclear, ambiguous with border color and 

## Solution

Rename the `UiColor` component (and associated fields) to `BackgroundColor` / `background_colorl`.

## Migration Guide

`UiColor` has been renamed to `BackgroundColor`. This change affects `NodeBundle`, `ButtonBundle` and `ImageBundle`. In addition, the corresponding field on `ExtractedUiNode` has been renamed to `background_color` for consistency.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

Fixes bevyengine#6078. The `UiColor` component is unhelpfully named: it is unclear, ambiguous with border color and 

## Solution

Rename the `UiColor` component (and associated fields) to `BackgroundColor` / `background_colorl`.

## Migration Guide

`UiColor` has been renamed to `BackgroundColor`. This change affects `NodeBundle`, `ButtonBundle` and `ImageBundle`. In addition, the corresponding field on `ExtractedUiNode` has been renamed to `background_color` for consistency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Remove or rename UiColor
5 participants