feat: add support for share menu on macOS (#25629)
This commit is contained in:
parent
89c04b3c6c
commit
6b6ffbdd10
17 changed files with 316 additions and 6 deletions
19
lib/browser/api/share-menu.ts
Normal file
19
lib/browser/api/share-menu.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { BrowserWindow, Menu, SharingItem, PopupOptions } from 'electron/main';
|
||||
|
||||
class ShareMenu {
|
||||
private menu: Menu;
|
||||
|
||||
constructor (sharingItem: SharingItem) {
|
||||
this.menu = new (Menu as any)({ sharingItem });
|
||||
}
|
||||
|
||||
popup (options?: PopupOptions) {
|
||||
this.menu.popup(options);
|
||||
}
|
||||
|
||||
closePopup (browserWindow?: BrowserWindow) {
|
||||
this.menu.closePopup(browserWindow);
|
||||
}
|
||||
}
|
||||
|
||||
export default ShareMenu;
|
Loading…
Add table
Add a link
Reference in a new issue