fix(touch_bar): blurry native images

This commit is contained in:
Elian Doran 2025-03-08 12:01:32 +02:00
parent 0430a9c3f5
commit f2f0f6178b
No known key found for this signature in database

View File

@ -19,9 +19,21 @@ export default class TouchBarWidget extends Component {
} }
#buildIcon(name: string) { #buildIcon(name: string) {
return this.nativeImage const sourceImage = this.nativeImage.createFromNamedImage(name, [-1, 0, 1]);
.createFromNamedImage(name, [-1, 0, 1]) const newImage = this.nativeImage.createEmpty()
.resize({ height: 20 }); newImage.addRepresentation({
scaleFactor: 1,
width: 22,
height: 22,
buffer: sourceImage.resize({ height: 22 }).toBitmap()
});
newImage.addRepresentation({
scaleFactor: 2,
width: 44,
height: 44,
buffer: sourceImage.resize({ height: 44 }).toBitmap()
});
return newImage;
} }
#buildTouchBar() { #buildTouchBar() {