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

Use SVG icons #2749

Merged
merged 1 commit into from Jan 19, 2018
Merged

Use SVG icons #2749

merged 1 commit into from Jan 19, 2018

Conversation

jakwings
Copy link
Contributor

@jakwings jakwings commented Dec 7, 2017

Close #2739

Hope you like it.

addon-list

addon-profile

Toolbar:

toolbar-dark-enabled

toolbar-light-enabled

Disabled:

toolbar-dark-disabled

toolbar-light-disabled

Old Screenshots greasemonkey_screenshot_addon_list greasemonkey_screenshot_addon_profile

Toolbar:

greasemonkey_screenshot_toolbar_dark greasemonkey_screenshot_toolbar_light

Inactive:

greasemonkey_screenshot_inactive_dark greasemonkey_screenshot_inactive_light

@jakwings
Copy link
Contributor Author

jakwings commented Dec 7, 2017

Just added the license: CC BY-NC-SA 4.0: https://creativecommons.org/licenses/by-nc-sa/4.0/

I don't know the license of the original image. So if you demand, CC0 public license is also fine.

@arantius arantius added this to the 4.2 milestone Dec 7, 2017
@arantius
Copy link
Collaborator

arantius commented Dec 7, 2017

In a message from 2007, which I can find in GMail but not on the corresponding list archive (do they expire!?) the creator says "I'll release the logo in the same license as Greasemonkey (Open source, right? It doesn't say anywhere) to make everything easy."

@jakwings
Copy link
Contributor Author

jakwings commented Dec 8, 2017

Ok, I've updated the license: both MIT and CC BY-SA 4.0. The later also permits creation of derivatives in any image format.

@Sxderp
Copy link
Contributor

Sxderp commented Dec 14, 2017

Keeping the browser action as the original .png file?

@jakwings
Copy link
Contributor Author

jakwings commented Dec 15, 2017

Don't know why it can override the png for browser_action... Updated. (Maybe this: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/browser_action#Choosing_icon_sizes)

@arantius
Copy link
Collaborator

arantius commented Jan 5, 2018

So I'm seeing the browser action button go from:

screenshot from 2018-01-05 10 51 51

to:

screenshot from 2018-01-05 10 52 10

And in the add-on manager, from:

screenshot from 2018-01-05 10 55 14

to:

screenshot from 2018-01-05 10 54 57

In AOM that's a pretty close match but something about the colors are off. In the button, the eyes are ... glassy? And maybe it's the lighter color, but the mouth also mostly disappears/loses detail.

@arantius arantius modified the milestones: 4.2, 4.3 Jan 5, 2018
@jakwings
Copy link
Contributor Author

jakwings commented Jan 6, 2018

original svg 1x
svg 2x

With larger eyes and bigger mouth: https://htmlpreview.github.io/?https://github.com/jakwings/greasemonkey/blob/30e549afce81872a6c905b1780677a52772f0f22/skin/icon.svg

@jakwings
Copy link
Contributor Author

@Sxderp
Copy link
Contributor

Sxderp commented Jan 14, 2018

Assuming the .svg is to be used everywhere, then the setIcon in src/bg/is-enabled.js will need an update, for the .svg and the sizes per the 'imageData' on the above linked page.

@jakwings
Copy link
Contributor Author

Among the functions from src/bg/is-enabled.js, it seems that only getGlobalEnabled() is used outside of tests. Is a grayscale icon still needed?

@Sxderp
Copy link
Contributor

Sxderp commented Jan 15, 2018

Among the functions from src/bg/is-enabled.js, it seems that only getGlobalEnabled() is used outside of tests.

The other functions are used indirectly. When a 'EnabledToggle' message is sent to the background the onEnableToggle() function will be called. Eventually leading to setIcon(). In which the icon (for the browser action / Monkey Menu) is swapped depending on the current state. If the extension is disabled then the icon is set to a more muted color scheme. As far as I can tell, with your current branch, when you use the Monkey Menu to toggle the extension on / off, the icons are replaced with the original .png images per these lines. I linked to the MDN page describing the API in an earlier comment.

@jakwings
Copy link
Contributor Author

jakwings commented Jan 15, 2018

Ah, I forgot to check the disable button on the addon page. But testing with Firefox Developer Edition, both the grayscaled icon on the addon page and the transparent one on the toolbar (actually, still the original icon32.png) are auto-generated for me. The logic for using svg icons is weird here… setIcon() was indeed called after the menu item "Greasemonkey is active" was clicked.

disabled

@jakwings
Copy link
Contributor Author

Exactly, the grayscale icon is drawn by applying the CSS rule filter: grayscale(1).

@jakwings
Copy link
Contributor Author

jakwings commented Jan 15, 2018

@Sxderp
Copy link
Contributor

Sxderp commented Jan 15, 2018

Set icon is working properly. When you toggle the add-on using the Greasemonkey menu (pressing the browser action icon on the toolbar) the icon changes.

@jakwings
Copy link
Contributor Author

Ah, embarrassing… so my initial screenshots for the toolbar icon are false (no sure it is good or bad). I need to polish the svg icon more. (Currently, left:original right:svg toolbar )

@jakwings
Copy link
Contributor Author

setIcon() updated. Latest screenshots with the svg icon:

addon-list

addon-profile

Toolbar:

toolbar-dark-enabled

toolbar-light-enabled

Disabled:

toolbar-dark-disabled

toolbar-light-disabled

The icon is licensed under the MIT license (provided by Greasemonkey) or
the Creative Commons license (CC BY-SA 4.0), at your option.
@Sxderp Sxderp mentioned this pull request Jan 19, 2018
@arantius arantius merged commit bf16238 into greasemonkey:master Jan 19, 2018
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.

None yet

3 participants