Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Commit 317ee43

Browse files
committed
fix copy & paste on mac os. fixes #28
1 parent fa3efb6 commit 317ee43

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/index.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,38 @@ app.on('ready', () => {
7373
gtt._dump('Running on ' + gtt._platform);
7474
gtt.setTrayWindow();
7575
gtt.setTray();
76+
gtt.addApplicationMenu();
7677
gtt._watchers.config.add();
7778
gtt._watchers.frames.add();
7879
}, 100);
7980
});
8081

82+
/**
83+
* Add application menu
84+
*/
85+
gtt.addApplicationMenu = () => {
86+
let template = [{
87+
label: "gtt taskbar",
88+
submenu: [
89+
{ label: "About gtt taskbar", selector: "orderFrontStandardAboutPanel:" },
90+
{ type: "separator" },
91+
{ label: "Quit", accelerator: "Command+Q", click: function() { app.quit(); }}
92+
]}, {
93+
label: "Edit",
94+
submenu: [
95+
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
96+
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
97+
{ type: "separator" },
98+
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
99+
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
100+
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
101+
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
102+
]}
103+
];
104+
105+
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
106+
};
107+
81108
/**
82109
* Create and open the list window.
83110
*/

0 commit comments

Comments
 (0)