Skip to content

Commit 34b74a5

Browse files
Merge branch 'fix-shortcuts-on-desktop-0yna'
2 parents 127ed6b + 4289110 commit 34b74a5

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

desktop/resources/js/main.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,35 @@ async function init() {
493493
console.log('[Vibora] Neutralino initialized');
494494
console.log('[Vibora] OS:', NL_OS);
495495

496+
// Set up native menu for macOS (required for Cmd+C/V/X/A shortcuts to work)
497+
if (NL_OS === 'Darwin') {
498+
await Neutralino.window.setMainMenu([
499+
{
500+
id: 'app',
501+
text: 'Vibora',
502+
menuItems: [
503+
{ id: 'about', text: 'About Vibora' },
504+
{ text: '-' },
505+
{ id: 'quit', text: 'Quit Vibora', shortcut: 'q', action: 'terminate:' }
506+
]
507+
},
508+
{
509+
id: 'edit',
510+
text: 'Edit',
511+
menuItems: [
512+
{ id: 'undo', text: 'Undo', shortcut: 'z', action: 'undo:' },
513+
{ id: 'redo', text: 'Redo', shortcut: 'Z', action: 'redo:' },
514+
{ text: '-' },
515+
{ id: 'cut', text: 'Cut', shortcut: 'x', action: 'cut:' },
516+
{ id: 'copy', text: 'Copy', shortcut: 'c', action: 'copy:' },
517+
{ id: 'paste', text: 'Paste', shortcut: 'v', action: 'paste:' },
518+
{ id: 'selectAll', text: 'Select All', shortcut: 'a', action: 'selectAll:' }
519+
]
520+
}
521+
]);
522+
console.log('[Vibora] macOS menu configured');
523+
}
524+
496525
// Check for --dev flag in command line args
497526
isDevMode = typeof NL_ARGS !== 'undefined' && NL_ARGS.includes('--dev');
498527
if (isDevMode) {

0 commit comments

Comments
 (0)