kopia lustrzana https://github.com/dceejay/electron-node-red
Don't auto hide View menu on windows and Linux
rodzic
ef04bf5e87
commit
1ec358a110
|
@ -1,18 +1,15 @@
|
||||||
|
|
||||||
dist/*
|
dist/*
|
||||||
lib/*
|
lib/*
|
||||||
package-lock.json
|
|
||||||
node_modules
|
node_modules
|
||||||
|
logs
|
||||||
.config.json
|
.config.json
|
||||||
.flows.json.backup
|
.electronflow*
|
||||||
.sessions.json
|
.sessions.json
|
||||||
*darwin-x64*
|
*darwin-x64*
|
||||||
*linux-x64*
|
*linux-x64*
|
||||||
*win32-x64*
|
*win32-x64*
|
||||||
*.back
|
*.back*
|
||||||
.config.json.backup
|
|
||||||
.electronflow*
|
|
||||||
*.backup
|
|
||||||
logs
|
|
||||||
*.log
|
*.log
|
||||||
yarn.lock
|
*lock*
|
||||||
|
*error*
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
docker run --rm -ti --env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') --env ELECTRON_CACHE="/root/.cache/electron" --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" -v ${PWD}:/project -v ${PWD##*/}-node-modules:/project/node_modules -v ~/.cache/electron:/root/.cache/electron -v ~/.cache/electron-builder:/root/.cache/electron-builder electronuserland/builder:wine && yarn && yarn dist
|
docker run --rm -ti --env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') --env ELECTRON_CACHE="/root/.cache/electron" --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" -v ${PWD}:/project -v ${PWD##*/}-node-modules:/project/node_modules -v ~/.cache/electron:/root/.cache/electron -v ~/.cache/electron-builder:/root/.cache/electron-builder electronuserland/builder:wine
|
File diff suppressed because one or more lines are too long
9
main.js
9
main.js
|
@ -5,7 +5,7 @@ let options;
|
||||||
if (pkg.hasOwnProperty("NRelectron")) { options = pkg["NRelectron"] }
|
if (pkg.hasOwnProperty("NRelectron")) { options = pkg["NRelectron"] }
|
||||||
|
|
||||||
// Some settings you can edit if you don't set them in package.json
|
// Some settings you can edit if you don't set them in package.json
|
||||||
console.log(options)
|
//console.log(options)
|
||||||
const editable = options.editable || true; // set this to false to create a run only application - no editor/no console
|
const editable = options.editable || true; // set this to false to create a run only application - no editor/no console
|
||||||
const allowLoadSave = options.allowLoadSave || false; // set to true to allow import and export of flow file
|
const allowLoadSave = options.allowLoadSave || false; // set to true to allow import and export of flow file
|
||||||
const showMap = options.showMap || false; // set to true to add Worldmap to the menu
|
const showMap = options.showMap || false; // set to true to add Worldmap to the menu
|
||||||
|
@ -157,7 +157,7 @@ red_app.use(settings.httpNodeRoot,RED.httpNode);
|
||||||
|
|
||||||
// Create the Application's main menu
|
// Create the Application's main menu
|
||||||
var template = [{
|
var template = [{
|
||||||
label: 'Node-RED',
|
label: "View",
|
||||||
submenu: [
|
submenu: [
|
||||||
{ label: 'Import Flow',
|
{ label: 'Import Flow',
|
||||||
accelerator: "Shift+CmdOrCtrl+O",
|
accelerator: "Shift+CmdOrCtrl+O",
|
||||||
|
@ -320,17 +320,18 @@ function createWindow() {
|
||||||
height: 768,
|
height: 768,
|
||||||
icon: path.join(__dirname, nrIcon),
|
icon: path.join(__dirname, nrIcon),
|
||||||
fullscreenable: true,
|
fullscreenable: true,
|
||||||
|
autoHideMenuBar: false,
|
||||||
kiosk: kioskMode,
|
kiosk: kioskMode,
|
||||||
autoHideMenuBar: true,
|
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: false
|
nodeIntegration: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const menu = Menu.buildFromTemplate(template);
|
const menu = Menu.buildFromTemplate(template);
|
||||||
Menu.setApplicationMenu(menu);
|
Menu.setApplicationMenu(menu);
|
||||||
|
|
||||||
|
if (process.platform !== 'darwin') { mainWindow.autoHideMenuBar(true); }
|
||||||
mainWindow.loadURL(`file://${__dirname}/load.html`);
|
mainWindow.loadURL(`file://${__dirname}/load.html`);
|
||||||
//if (process.platform !== 'darwin') { mainWindow.setAutoHideMenuBar(true); }
|
|
||||||
|
|
||||||
mainWindow.webContents.on('did-get-response-details', function(event, status, newURL, originalURL, httpResponseCode) {
|
mainWindow.webContents.on('did-get-response-details', function(event, status, newURL, originalURL, httpResponseCode) {
|
||||||
if ((httpResponseCode == 404) && (newURL == ("http://localhost:"+listenPort+urlStart))) {
|
if ((httpResponseCode == 404) && (newURL == ("http://localhost:"+listenPort+urlStart))) {
|
||||||
|
|
Ładowanie…
Reference in New Issue