Skip to content

Replace bg_color with bgcolor#742

Merged
aaronayres35 merged 2 commits into
masterfrom
remove-use-of-bg_color
May 18, 2021
Merged

Replace bg_color with bgcolor#742
aaronayres35 merged 2 commits into
masterfrom
remove-use-of-bg_color

Conversation

@aaronayres35
Copy link
Copy Markdown
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
@aaronayres35 aaronayres35 requested a review from rahulporuri May 18, 2021 11:57
Copy link
Copy Markdown
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

Comment thread examples/demo/basic/contour_cmap_plot.py
Comment thread examples/demo/basic/contour_cmap_plot.py
Item(
"plot",
editor=ComponentEditor(size=size, bgcolor=bg_color),
editor=ComponentEditor(size=size, bgcolor=bgcolor),
Copy link
Copy Markdown
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.

# Attributes to use for the plot view.
size = (650, 650)
title = "Scatter plot with selection"
bg_color = "lightgray"
Copy link
Copy Markdown
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
Copy Markdown
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

# Attributes to use for the plot view.
size = (650, 650)
title = "Scatter plot with selection"
bg_color = "lightgray"
Copy link
Copy Markdown
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
Copy Markdown
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