mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-13 11:29:53 +03:00
Reame, Context menu, Blackbox tab fix
This commit is contained in:
parent
2efebecb61
commit
5e66e9e1b0
4 changed files with 40 additions and 13 deletions
22
js/main.js
22
js/main.js
|
@ -1,4 +1,4 @@
|
|||
const { app, BrowserWindow, ipcMain } = require('electron');
|
||||
const { app, BrowserWindow, ipcMain, Menu, MenuItem } = require('electron');
|
||||
const windowStateKeeper = require('electron-window-state');
|
||||
const path = require('path');
|
||||
const Store = require('electron-store');
|
||||
|
@ -76,6 +76,26 @@ function createWindow() {
|
|||
},
|
||||
});
|
||||
|
||||
mainWindow.webContents.on('context-menu', (_, props) => {
|
||||
const menu = new Menu() ;
|
||||
menu.append(new MenuItem({ label: "Undo", role: "undo", accelerator: 'CmdOrCtrl+Z', visible: props.isEditable }));
|
||||
menu.append(new MenuItem({ label: "Redo", role: "redo", accelerator: 'CmdOrCtrl+Y', visible: props.isEditable }));
|
||||
menu.append(new MenuItem({ type: "separator", visible: props.isEditable }));
|
||||
menu.append(new MenuItem({ label: 'Cut', role: 'cut', accelerator: 'CmdOrCtrl+X', visible: props.isEditable && props.selectionText }));
|
||||
menu.append(new MenuItem({ label: 'Copy', role: 'copy', accelerator: 'CmdOrCtrl+C', visible: props.selectionText }));
|
||||
menu.append(new MenuItem({ label: 'Paste', role: 'paste', accelerator: 'CmdOrCtrl+V', visible: props.isEditable }));
|
||||
menu.append(new MenuItem({ label: "Select all", role: 'selectAll', accelerator: 'CmdOrCtrl+A', visible: props.isEditable}));
|
||||
|
||||
|
||||
|
||||
menu.items.forEach(item => {
|
||||
if (item.visible) {
|
||||
menu.popup();
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
|
||||
event.preventDefault();
|
||||
selectBluetoothCallback = callback;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue