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