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

Allow a way to detect extensions in the activity bar #83171

Closed
miguelsolorio opened this issue Oct 23, 2019 · 4 comments
Closed

Allow a way to detect extensions in the activity bar #83171

miguelsolorio opened this issue Oct 23, 2019 · 4 comments
Assignees
Labels
debt Code quality issues
Milestone

Comments

@miguelsolorio
Copy link
Contributor

Related to the discussion in #83113, we need to find a cleaner way to detect if an item in the activity bar is an extension:

const isExtension = this.activity.cssClass?.indexOf('extensionViewlet') === 0;
if (!isExtension) {
// Apply foreground color to activity bar items (codicons)
this.label.style.color = foreground ? foreground.toString() : '';

This is due to the fact that extensions provide a custom svg and use a mask + background color to make them themeable. However our activity bar now uses an icon font and needs to use the color property instead.

FYI @isidorn

@miguelsolorio miguelsolorio added the debt Code quality issues label Oct 23, 2019
@miguelsolorio miguelsolorio added this to the November 2019 milestone Oct 23, 2019
@frobinsonj
Copy link
Contributor

@misolori I have a local fix that makes the first case of the isExtension check redundant. Would you be interested in a PR that only fixes this first case?

frobinsonj@9e16f66

@miguelsolorio
Copy link
Contributor Author

@frobinsonj ideally we'd like to solve this for both parts

@sandy081
Copy link
Member

sandy081 commented Nov 18, 2019

@misolori Cleaned it up. It seems, you do not need to know if the activity item is coming from extension or not, instead you have to know if the activity item is using iconUrl to render icon. So changed the code to use this as a differentiation factor to apply proper styles. Please take a look.

@miguelsolorio
Copy link
Contributor Author

This is great, thanks for updating this!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues
Projects
None yet
Development

No branches or pull requests

3 participants