From 0430a9c3f5800cd9c1b182c546e0dbb2f20942e3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 8 Mar 2025 11:55:09 +0200 Subject: [PATCH] feat(touch_bar): resize icon even if blurry --- src/public/app/widgets/touch_bar.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/public/app/widgets/touch_bar.ts b/src/public/app/widgets/touch_bar.ts index 272f0cb1c..076a52fdd 100644 --- a/src/public/app/widgets/touch_bar.ts +++ b/src/public/app/widgets/touch_bar.ts @@ -18,14 +18,19 @@ export default class TouchBarWidget extends Component { this.remote.getCurrentWindow().setTouchBar(touchBarData); } + #buildIcon(name: string) { + return this.nativeImage + .createFromNamedImage(name, [-1, 0, 1]) + .resize({ height: 20 }); + } + #buildTouchBar() { - const { nativeImage } = this; const { TouchBar } = this.remote; const { TouchBarButton } = this.remote.TouchBar; const items = [ new TouchBarButton({ - icon: nativeImage.createFromNamedImage("NSTouchBarAddDetailTemplate", [-1, 0, 1]), + icon: this.#buildIcon("NSTouchBarAddDetailTemplate"), click: () => { console.log("New note pressed."); }