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
Dim toolbar icon on unstyled tabs #115
Conversation
@@ -11,19 +12,21 @@ function webNavigationListener(method, data) { | |||
return; | |||
} | |||
getStyles({matchUrl: data.url, enabled: true, asHash: true}, function(styleHash) { | |||
chrome.tabs.sendMessage(data.tabId, {method: method, styles: styleHash}); | |||
// Don't show the badge for frames | |||
if (data.frameId == 0 && prefs.getPref("show-badge")) { |
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.
data.frameId is 0 here because of line 11/12.
I've put the logo source at https://userstyles.org/newlogo.xcf . Not sure if that's helpful at this point. |
To create the svg I've previously used the 128px icon (which is slightly distorted) as a source, so now I've fixed a few discrepancies using the real source and realigned all the icons on pixel grid. |
It works inconsistently when enabling a style on the new tab page. |
|
Rebased on master. |
With two tabs and one global style:
|
Works because Chrome *overlays* user-specified badge color onto its own default color.
Fixed, hopefully. |
Dim toolbar icon on unstyled tabs
Closes #100
Unstyled tab icon is dimmed:
S
remains the same, bg = 20%, outer border = 50% opacity. Transparent background should look good on non-bright themes, supposedly, unlike 100% white bg that would have been brighter than the default bg.in disableAll mode the icon is also dimmed, style count badge is displayed on a lightgray background #aaa - should we have an option to customize this color to make it look good with dark themes?
The default 19x19 icon was recreated using SVG vector source:
S
and its outline were straightened a bit (check it out using GitHub's "Swipe" preview mode in diff)38x38 retina-aware icons were added. Not tested.
All icons were compressed with
pngquant --quality 50-80
Default icon blinks for an instant here (usually less than 0.1s) when I navigate a styled site, this is what happens:
updateIcon
: OK(particularly wacky when you navigate from an unstyled page to a styled one)
updateIcon
: OKThe whim part apparently is incurable as there's nothing between onBeforeNavigate & onCommitted:
Although we can leave the colored icon as default in manifest.json and not care about it being incorrect on about:blank and other chrome:// pages except for Edit and Manage.
Other extensions are updating their icons after ~1 second or so, which makes them look not too smart in comparison.