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 ThemeIcon in WebviewPanel.iconPath #90616

Open
ridiculous-thought opened this issue Feb 13, 2020 · 8 comments · May be fixed by #92122
Open

Allow ThemeIcon in WebviewPanel.iconPath #90616

ridiculous-thought opened this issue Feb 13, 2020 · 8 comments · May be fixed by #92122
Assignees
Labels
api feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities icons-product Issues for in-product icons webview Webview issues
Milestone

Comments

@ridiculous-thought
Copy link

Issue Type: Feature Request

You can only pass an Uri or an object containing Uris to WebviewPanel.iconPath, while iconPath on QuickInputButton and TreeItem also supports ThemeIcon. This would increase codicon reusability.

VS Code version: Code 1.42.0 (ae08d54, 2020-02-06T10:51:34.058Z)
OS version: Windows_NT x64 10.0.18362

@mjbvz mjbvz added api webview Webview issues labels Feb 13, 2020
@mjbvz mjbvz added this to the Backlog milestone Mar 5, 2020
@mjbvz mjbvz added the feature-request Request for new features or functionality label Mar 5, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Mar 5, 2020

@bpasero I believe we should change how editors get their icons to support this. My proposal is to add a IEditorInput.icon property that lets editor inputs set their icon directly instead of going through css rules based on the resource. This could also be used for our welcome page and a few other places in VS Code core that have to use css for this today:

background-image: url('../../code-icon.svg');

mjbvz added a commit that referenced this issue Mar 5, 2020
Fixes #90616

Enables using theme icons in the webview.iconPath

This fixes the problem in a very ugly way by inlining all the codicon css classes. We should look into a proper fix
mjbvz added a commit that referenced this issue Mar 5, 2020
Fixes #90616

Enables using theme icons in the webview.iconPath

This fixes the problem in a very ugly way by inlining all the codicon css classes. We should look into a proper fix
@mjbvz mjbvz linked a pull request Mar 5, 2020 that will close this issue
@bpasero
Copy link
Member

bpasero commented Mar 6, 2020

Works for me.

@bpasero bpasero added the workbench-editors Managing of editor widgets in workbench window label Mar 6, 2020
@bpasero bpasero removed their assignment Apr 14, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Apr 27, 2020

@aeschli Adding you for help with #92122. Let's try looking into this in May

@mjbvz mjbvz modified the milestones: Backlog, May 2020 Apr 27, 2020
@mjbvz mjbvz modified the milestones: May 2020, June 2020 Jun 1, 2020
@aeschli aeschli modified the milestones: June 2020, July 2020 Jun 29, 2020
@mjbvz mjbvz modified the milestones: July 2020, Backlog Jul 27, 2020
@bpasero bpasero removed the workbench-editors Managing of editor widgets in workbench window label Sep 6, 2020
@aeschli aeschli removed their assignment Nov 6, 2020
@mjbvz mjbvz added the help wanted Issues identified as good community contribution opportunities label May 21, 2021
@miguelsolorio miguelsolorio added the icons-product Issues for in-product icons label Sep 3, 2021
@yiqing-zhao
Copy link

Any update? Looking forward to use ThemeIcons in webviews!

@daviddossett daviddossett removed their assignment Dec 14, 2022
@nora-soderlund
Copy link

What is the current workaround?

@bpasero
Copy link
Member

bpasero commented Dec 14, 2023

Now @benibenj introduced support for editors to return a ThemeIcon:

/**
* Returns the icon which represents this editor input.
* If undefined, the default icon will be used.
*/
getIcon(): ThemeIcon | undefined {
return undefined;
}

So I think this can move along, unless I miss something.

@nora-soderlund
Copy link

nora-soderlund commented Dec 14, 2023

What about setting a ThemeIcon? @bpasero

I might be missing something.

@bpasero
Copy link
Member

bpasero commented Dec 14, 2023

Yeah I muss the bigger picture of this issue, I was just to mention we made some progress in core for parts of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities icons-product Issues for in-product icons webview Webview issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants