Skip to content

Commit

Permalink
feat(main): add createPopupMenu constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
antonreshetov committed Mar 31, 2022
1 parent daf42b5 commit cc806ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/components/menu.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { MenuItemConstructorOptions } from 'electron'
import { Menu, BrowserWindow } from 'electron'

export const createPopupMenu = (template: MenuItemConstructorOptions[]) => {
const menu = Menu.buildFromTemplate(template)
menu.popup({ window: BrowserWindow.getFocusedWindow()! })
}

0 comments on commit cc806ba

Please sign in to comment.