-
Notifications
You must be signed in to change notification settings - Fork 42
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
Use size class for all icons, not just symbols #149
Use size class for all icons, not just symbols #149
Conversation
Symbols do not require height or width but icons without height and width will render at their original size instead of rendering at 16x16. Fixes jenkinsci#148
my proposal are not mandatory, @MarkEWaite let me know if you want to change it or not. |
Thanks for your comment @mPokornyETM . I didn't see any proposed changes in your comment. Maybe your proposed changes are not yet submitted? |
sorry, I mean my comments |
I've replaced I'd like a review from @strangelookingnerd if time allows. However, I'd also like to resolve the bug before the end of the week if possible. My interactive testing of #130 did not detect that regression and I'd like to fix it promptly so that other users are not disturbed by it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/main/resources/com/jenkinsci/plugins/badge/action/BadgeAction/badge.jelly
Outdated
Show resolved
Hide resolved
src/main/resources/com/jenkinsci/plugins/badge/action/BadgeAction/badge.jelly
Outdated
Show resolved
Hide resolved
src/main/resources/com/jenkinsci/plugins/badge/action/BadgeAction/badge.jelly
Outdated
Show resolved
Hide resolved
<!-- Icons that are not symbols need height and width --> | ||
<j:if test="${it.iconPath.indexOf('symbol-') != 0}"> | ||
<j:if test="${it.link == null}"> | ||
<l:icon src="${it.iconPath}" class="${it.iconClass}" style="${badgeStyle}" htmlTooltip="${it.text}" height="16" width="16" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not taotally happy with hardcoded numbers. Are there no spacing in the design-library ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a very good question. @janfaracik is there a better way to express this? I'm a novice with Jelly and even more of a novice with CSS and page layout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarkEWaite I think we could get away with removing the width
and height
attributes and delegate the sizing to class
here.
By removing the if
check in
if (isJenkinsSymbolRef(this.iconPath)) { |
icon-sm
and thus be sized correctly. No hardcoded size required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much for the recommendation. That makes the code much simpler and avoids conditional logic in the jelly file. Implemented in 535e18f
I‘ll have a look at it later today, tomorrow latest. |
Uses the common way of specifying sizes now instead of explicitly declaring height and width attributes of the image. Simplifies the code dramatically and avoids conditionals in the jelly file.
Use size class for all icons, not just symbols
Symbols do not require height or width but icons without height and width will render at their original size instead of rendering at the standard size for icons.
Fixes #148
Testing done
Confirmed that before this change, the following icon renders incorrectly as a 48x48 image:
Confirmed that before this change, the following icon renders correctly:
Confirmed that after this change, the following icon renders correctly as a 16x16 image:
Confirmed that after this change, the following icon renders correctly:
Submitter checklist