Skip to content

Commit a23df84

Browse files
authored
fix: add context menu (#128)
1 parent afa8835 commit a23df84

File tree

1 file changed

+38
-0
lines changed
  • packages/desktop/electron/lib

1 file changed

+38
-0
lines changed

packages/desktop/electron/lib/menu.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,41 @@ const buildTemplate = () => {
150150
})
151151
return template
152152
}
153+
154+
/**
155+
* Creates context menu
156+
* @returns {Menu} Context menu
157+
*/
158+
export const contextMenu = () =>
159+
Menu.buildFromTemplate([
160+
{
161+
label: state.strings.undo,
162+
role: 'undo',
163+
},
164+
{
165+
label: state.strings.redo,
166+
role: 'redo',
167+
},
168+
{
169+
type: 'separator',
170+
},
171+
{
172+
label: state.strings.cut,
173+
role: 'cut',
174+
},
175+
{
176+
label: state.strings.copy,
177+
role: 'copy',
178+
},
179+
{
180+
label: state.strings.paste,
181+
role: 'paste',
182+
},
183+
{
184+
type: 'separator',
185+
},
186+
{
187+
label: state.strings.selectAll,
188+
role: 'selectAll',
189+
},
190+
])

0 commit comments

Comments
 (0)