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

feat: add support for icon contribution by extensions #2984

Merged
merged 1 commit into from Jun 26, 2023

Conversation

benoitf
Copy link
Collaborator

@benoitf benoitf commented Jun 23, 2023

What does this PR do?

add support for icon contribution by extensions

Screenshot/screencast of this PR

image

What issues does this PR fix or reference?

fixes #1525

How to test this PR?

Add contribution in an extension

something like

download and store it at the root path of an extension
https://github.com/twbs/icons/blob/main/font/fonts/bootstrap-icons.woff2

add in package.json

    "icons": {
      "my-custom-icon": {
        "description": "My icon",
        "default": {
          "fontPath": "bootstrap-icons.woff2",
          "fontCharacter": "\\F62B"
        }
      }
    }

to know the fontCharacter, use for example https://fontdrop.info (and upload the .woff2 file or create a file from svg using https://github.com/itgalaxy/webfont cli

and then for example for a status bar item, for the status icon, use instead of fa fa-something ${my-custom-icon}

unit tests provided

fixes containers#1525

Signed-off-by: Florent Benoit <fbenoit@redhat.com>
@benoitf benoitf requested a review from a team as a code owner June 23, 2023 12:19
@benoitf benoitf requested review from jeffmaury and cdrage and removed request for a team June 23, 2023 12:19
Copy link
Collaborator

@deboer-tim deboer-tim left a comment

Choose a reason for hiding this comment

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

I spent a long time trying to figure out why this wasn't working on my machine: the icons were being picked up and registered correctly, the StatusBarItem was rendering right, but there was no icon or font showing up in IconStyle.

I eventually figured out there was no extensions-started event - because the podman extension never finished starting on my clone. Deleting the extension made everything else fail really badly, but my icon showed up amid the mess. 👍🏼

So +1, and I'll file another bug for extension startup.

@benoitf benoitf merged commit 7dfcec4 into containers:main Jun 26, 2023
8 checks passed
@podman-desktop-bot podman-desktop-bot added this to the 1.2.0 milestone Jun 26, 2023
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.

add contribution for icons
3 participants