-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: copy album art to clipboard
- Loading branch information
1 parent
5f892d4
commit 09b3f1f
Showing
5 changed files
with
87 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Menu from '@mui/material/Menu'; | ||
import MenuItem from '@mui/material/MenuItem'; | ||
|
||
type AlbumArtMenuProps = { | ||
anchorEl: HTMLElement | null; | ||
onClose: () => void; | ||
song: string; | ||
}; | ||
|
||
export default function AlbumArtMenu(props: AlbumArtMenuProps) { | ||
const { anchorEl, onClose, song } = props; | ||
|
||
const copyAlbumArt = () => { | ||
window.electron.ipcRenderer.sendMessage('copy-art-to-clipboard', { | ||
song, | ||
}); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<Menu | ||
id="basic-menu" | ||
anchorEl={anchorEl} | ||
open | ||
MenuListProps={{ | ||
'aria-labelledby': 'basic-button', | ||
}} | ||
onClose={onClose} | ||
anchorOrigin={{ | ||
vertical: 'center', | ||
horizontal: 'center', | ||
}} | ||
> | ||
<MenuItem | ||
sx={{ | ||
fontSize: '11px', | ||
}} | ||
onClick={copyAlbumArt} | ||
> | ||
Copy Image | ||
</MenuItem> | ||
</Menu> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters