mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-12 20:02:28 +08:00
feat(touch_bar): resize icon even if blurry
This commit is contained in:
parent
3358b405e9
commit
0430a9c3f5
@ -18,14 +18,19 @@ export default class TouchBarWidget extends Component {
|
|||||||
this.remote.getCurrentWindow().setTouchBar(touchBarData);
|
this.remote.getCurrentWindow().setTouchBar(touchBarData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#buildIcon(name: string) {
|
||||||
|
return this.nativeImage
|
||||||
|
.createFromNamedImage(name, [-1, 0, 1])
|
||||||
|
.resize({ height: 20 });
|
||||||
|
}
|
||||||
|
|
||||||
#buildTouchBar() {
|
#buildTouchBar() {
|
||||||
const { nativeImage } = this;
|
|
||||||
const { TouchBar } = this.remote;
|
const { TouchBar } = this.remote;
|
||||||
const { TouchBarButton } = this.remote.TouchBar;
|
const { TouchBarButton } = this.remote.TouchBar;
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
new TouchBarButton({
|
new TouchBarButton({
|
||||||
icon: nativeImage.createFromNamedImage("NSTouchBarAddDetailTemplate", [-1, 0, 1]),
|
icon: this.#buildIcon("NSTouchBarAddDetailTemplate"),
|
||||||
click: () => {
|
click: () => {
|
||||||
console.log("New note pressed.");
|
console.log("New note pressed.");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user