Skip to content

Commit 2a2c292

Browse files
committed
Improve TouchBar button icon display
1 parent 525c033 commit 2a2c292

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

app/utils/devMenu.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,20 @@ export const invokeDevMethod = (name) => () => {
8888
};
8989

9090
const hslShift = [0.5, 0.2, 0.8];
91-
const icon = (name) => nativeImage.createFromNamedImage(name, hslShift);
91+
const icon = (name, resizeOpts) => {
92+
const image = nativeImage.createFromNamedImage(name, hslShift);
93+
return image.resize(resizeOpts);
94+
};
9295

9396
let namedImages;
9497
const initNamedImages = () => {
9598
if (process.platform !== 'darwin' || namedImages) return;
9699
namedImages = {
97-
reload: icon('NSTouchBarRefreshTemplate'),
98-
toggleElementInspector: icon('NSTouchBarQuickLookTemplate'),
99-
networkInspect: icon('NSTouchBarRecordStartTemplate'),
100-
prev: icon('NSTouchBarGoBackTemplate'),
101-
next: icon('NSTouchBarGoForwardTemplate'),
100+
reload: icon('NSTouchBarRefreshTemplate', { height: 20 }),
101+
toggleElementInspector: icon('NSTouchBarQuickLookTemplate', { height: 18 }),
102+
networkInspect: icon('NSTouchBarRecordStartTemplate', { height: 20 }),
103+
prev: icon('NSTouchBarGoBackTemplate', { height: 20 }),
104+
next: icon('NSTouchBarGoForwardTemplate', { height: 20 }),
102105
};
103106
};
104107

0 commit comments

Comments
 (0)