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

Switch to SVGs for most icons #393

Merged
merged 10 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<changelist>-SNAPSHOT</changelist>
<hpi.compatibleSinceVersion>2.2.0</hpi.compatibleSinceVersion>
<java.level>8</java.level>
<jenkins.version>2.271</jenkins.version>
<jenkins.version>2.281-SNAPSHOT</jenkins.version> <!-- TODO https://github.com/jenkinsci/jenkins/pull/5065 -->
timja marked this conversation as resolved.
Show resolved Hide resolved
<useBeta>true</useBeta>
</properties>

Expand Down Expand Up @@ -117,8 +117,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.263.x</artifactId>
<version>23</version>
<artifactId>bom-2.277.x</artifactId>
<version>24</version>
timja marked this conversation as resolved.
Show resolved Hide resolved
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
import net.jcip.annotations.GuardedBy;
import org.apache.commons.lang.StringUtils;
import org.jenkins.ui.icon.Icon;
import org.jenkins.ui.icon.IconFormat;
import org.jenkins.ui.icon.IconSet;
import org.jenkins.ui.icon.IconSpec;
import org.jenkinsci.Symbol;
Expand Down Expand Up @@ -1585,54 +1586,54 @@ public List<SCMTrait<? extends SCMTrait<?>>> getTraitsDefaults() {

IconSet.icons.addIcon(
new Icon("icon-github-logo icon-sm",
"plugin/github-branch-source/images/16x16/github-logo.png",
Icon.ICON_SMALL_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#github-logo",
Copy link
Member Author

Choose a reason for hiding this comment

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

I've left the old github-logo image file in as it's used here:

+ "/plugin/github-branch-source/images/" + size + "/github-logo.png");

I'm not aware of a way to trigger that code though

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we return the same SVG regardless of size value?

Copy link
Member Author

@timja timja Feb 25, 2021

Choose a reason for hiding this comment

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

Yes we can, I'm just wary of touching UI code I can't test.

My point was I don't know if this code is possible to hit, at least on github.com

Icon.ICON_SMALL_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));
IconSet.icons.addIcon(
new Icon("icon-github-logo icon-md",
"plugin/github-branch-source/images/24x24/github-logo.png",
Icon.ICON_MEDIUM_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#github-logo",
Icon.ICON_MEDIUM_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));
IconSet.icons.addIcon(
new Icon("icon-github-logo icon-lg",
"plugin/github-branch-source/images/32x32/github-logo.png",
Icon.ICON_LARGE_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#github-logo",
Icon.ICON_LARGE_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));
IconSet.icons.addIcon(
new Icon("icon-github-logo icon-xlg",
"plugin/github-branch-source/images/48x48/github-logo.png",
Icon.ICON_XLARGE_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#github-logo",
Icon.ICON_XLARGE_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));

IconSet.icons.addIcon(
new Icon("icon-github-repo icon-sm",
"plugin/github-branch-source/images/16x16/github-repo.png",
Icon.ICON_SMALL_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#github-repo",
Icon.ICON_SMALL_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));
IconSet.icons.addIcon(
new Icon("icon-github-repo icon-md",
"plugin/github-branch-source/images/24x24/github-repo.png",
Icon.ICON_MEDIUM_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#github-repo",
Icon.ICON_MEDIUM_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));
IconSet.icons.addIcon(
new Icon("icon-github-repo icon-lg",
"plugin/github-branch-source/images/32x32/github-repo.png",
Icon.ICON_LARGE_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#github-repo",
Icon.ICON_LARGE_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));
IconSet.icons.addIcon(
new Icon("icon-github-repo icon-xlg",
"plugin/github-branch-source/images/48x48/github-repo.png",
Icon.ICON_XLARGE_STYLE));
"github-branch-source/images/svgs/sprite-github.svg#github-repo",
Icon.ICON_XLARGE_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));

IconSet.icons.addIcon(
new Icon("icon-github-branch icon-sm",
"plugin/github-branch-source/images/16x16/github-branch.png",
Icon.ICON_SMALL_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#git-branch",
Icon.ICON_SMALL_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));
IconSet.icons.addIcon(
new Icon("icon-github-branch icon-md",
"plugin/github-branch-source/images/24x24/github-branch.png",
Icon.ICON_MEDIUM_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#git-branch",
Icon.ICON_MEDIUM_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));
IconSet.icons.addIcon(
new Icon("icon-github-branch icon-lg",
"plugin/github-branch-source/images/32x32/github-branch.png",
Icon.ICON_LARGE_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#git-branch",
Icon.ICON_LARGE_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));
IconSet.icons.addIcon(
new Icon("icon-github-branch icon-xlg",
"plugin/github-branch-source/images/48x48/github-branch.png",
Icon.ICON_XLARGE_STYLE));
"plugin/github-branch-source/images/svgs/sprite-github.svg#git-branch",
Icon.ICON_XLARGE_STYLE, IconFormat.EXTERNAL_SVG_SPRITE));
}
}

Expand Down
Binary file removed src/main/webapp/images/16x16/github-branch.png
Binary file not shown.
Binary file removed src/main/webapp/images/16x16/github-repo.png
Binary file not shown.
Binary file removed src/main/webapp/images/24x24/github-branch.png
Binary file not shown.
Binary file removed src/main/webapp/images/24x24/github-repo.png
Binary file not shown.
Binary file removed src/main/webapp/images/32x32/github-branch.png
Binary file not shown.
Binary file removed src/main/webapp/images/32x32/github-repo.png
Binary file not shown.
Binary file removed src/main/webapp/images/48x48/github-branch.png
Binary file not shown.
Binary file removed src/main/webapp/images/48x48/github-repo.png
Binary file not shown.
12 changes: 12 additions & 0 deletions src/main/webapp/images/svgs/sprite-github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.