Skip to content

Commit

Permalink
Add 64px toolbar icon for 4K displays
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Mar 27, 2023
1 parent 08815e9 commit 10f9559
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
3 changes: 2 additions & 1 deletion platform/chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"browser_action": {
"default_icon": {
"16": "img/icon_16.png",
"32": "img/icon_32.png"
"32": "img/icon_32.png",
"64": "img/icon_64.png"
},
"default_title": "uBlock Origin",
"default_popup": "popup-fenix.html"
Expand Down
18 changes: 13 additions & 5 deletions platform/common/vapi-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,16 @@ if ( webext.browserAction instanceof Object ) {
browser.runtime.getManifest().browser_action.default_title +
' ({badge})';
const icons = [
{ path: { '16': 'img/icon_16-off.png', '32': 'img/icon_32-off.png' } },
{ path: { '16': 'img/icon_16.png', '32': 'img/icon_32.png' } },
{ path: {
'16': 'img/icon_16-off.png',
'32': 'img/icon_32-off.png',
'64': 'img/icon_64-off.png',
} },
{ path: {
'16': 'img/icon_16.png',
'32': 'img/icon_32.png',
'64': 'img/icon_64.png',
} },
];

(( ) => {
Expand All @@ -702,9 +710,8 @@ if ( webext.browserAction instanceof Object ) {

const imgs = [];
for ( let i = 0; i < icons.length; i++ ) {
const path = icons[i].path;
for ( const key in path ) {
if ( path.hasOwnProperty(key) === false ) { continue; }
for ( const key of Object.keys(icons[i].path) ) {
if ( parseInt(key, 10) >= 64 ) { continue; }
imgs.push({ i: i, p: key, cached: false });
}
}
Expand Down Expand Up @@ -818,6 +825,7 @@ if ( webext.browserAction instanceof Object ) {
path: {
'16': `img/icon_16${flavor}.png`,
'32': `img/icon_32${flavor}.png`,
'64': `img/icon_64${flavor}.png`,
}
});
browserAction.setBadgeText({ text });
Expand Down
3 changes: 2 additions & 1 deletion platform/firefox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"browser_style": false,
"default_icon": {
"16": "img/icon_16.png",
"32": "img/icon_32.png"
"32": "img/icon_32.png",
"64": "img/icon_64.png"
},
"default_title": "uBlock Origin",
"default_popup": "popup-fenix.html"
Expand Down
3 changes: 2 additions & 1 deletion platform/opera/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"browser_action": {
"default_icon": {
"16": "img/icon_16.png",
"32": "img/icon_32.png"
"32": "img/icon_32.png",
"64": "img/icon_64.png"
},
"default_popup": "popup-fenix.html",
"default_title": "uBlock Origin"
Expand Down

0 comments on commit 10f9559

Please sign in to comment.