mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
@ -1,10 +1,12 @@
|
||||
import { type NativeImage, TouchBar } from 'electron';
|
||||
import { nativeImage, type NativeImage, TouchBar } from 'electron';
|
||||
|
||||
import { createPlugin } from '@/utils';
|
||||
import getSongControls from '@/providers/song-controls';
|
||||
import registerCallback from '@/providers/song-info';
|
||||
import { t } from '@/i18n';
|
||||
|
||||
import youtubeMusicIcon from '@assets/youtube-music.png?asset&asarUnpack';
|
||||
|
||||
export default createPlugin({
|
||||
name: () => t('plugins.touchbar.name'),
|
||||
description: () => t('plugins.touchbar.description'),
|
||||
@ -89,9 +91,9 @@ export default createPlugin({
|
||||
pausePlayButton.label = songInfo.isPaused ? '▶️' : '⏸';
|
||||
|
||||
// Get image source
|
||||
songImage.icon = songInfo.image
|
||||
? songInfo.image.resize({ height: 23 })
|
||||
: undefined;
|
||||
songImage.icon = (
|
||||
songInfo.image ? songInfo.image : nativeImage.createFromPath(youtubeMusicIcon)
|
||||
).resize({ height: 23 });
|
||||
|
||||
window.setTouchBar(touchBar);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user