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

Replace bg_color with bgcolor #742

Merged
merged 2 commits into from
May 18, 2021
Merged

Replace bg_color with bgcolor #742

merged 2 commits into from
May 18, 2021

Conversation

aaronayres35
Copy link
Contributor

ref: enthought/enable#816 (review)

This PR removes uses of the soon to be removed, deprecated bg_color trait from enable. For consistency it renames all uses of bg_color in the codebase with bgcolor (even just temp variables), in order to keep consistent. Note, all changes occur in example code

@aaronayres35 aaronayres35 changed the title Replace bg_color with bgcolor (even in temp variables, for consistency) Replace bg_color with bgcolor May 18, 2021
Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

LGTM with a couple of comments/recommendations

examples/demo/basic/contour_cmap_plot.py Show resolved Hide resolved
examples/demo/basic/contour_cmap_plot.py Show resolved Hide resolved
@@ -79,7 +79,7 @@ class Demo(HasTraits):
Group(
Item(
"plot",
editor=ComponentEditor(size=size, bgcolor=bg_color),
editor=ComponentEditor(size=size, bgcolor=bgcolor),
Copy link
Contributor

Choose a reason for hiding this comment

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

FTR : ComponentEditor is the only place where I see someone set bgcolor on an enable AbstractWindow - and it sets bgcolor, not the deprecated bg_color.

@@ -96,7 +96,6 @@ def _create_plot_component():
# Attributes to use for the plot view.
size = (650, 650)
title = "Scatter plot with selection"
bg_color = "lightgray"
Copy link
Contributor

Choose a reason for hiding this comment

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

why not pass this to the ComponentEditor - like what we do in the other examples

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add that here in this PR. I deleted it just because previously this bg_color variable was just unused entirely.

It makes sense to actually use it though

@@ -87,7 +87,6 @@ def _create_plot_component():
# Attributes to use for the plot view.
size = (650, 650)
title = "Scatter plot with selection"
bg_color = "lightgray"
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above - why not pass this to the ComponentEditor, like we do with the other examples

@rahulporuri
Copy link
Contributor

Here's the original commit where bg_color was deprecated - enthought/enable@1f5e90f

@aaronayres35 aaronayres35 merged commit 0485083 into master May 18, 2021
@aaronayres35 aaronayres35 deleted the remove-use-of-bg_color branch May 18, 2021 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants