paulsutherland / Polyonic

An Electron Ionic application shell for creating Web Apps, Progressive Mobile Web Apps, Native Mobile Apps and Desktop Apps.
209 stars 44 forks source link

native Menu not appearing in Browserwindow #20

Closed lapak10 closed 6 years ago

lapak10 commented 6 years ago

Aim: To get native Menu Bar , like most of the electron apps have. Current Output : No error in console, but not getting any Menu in browserwindow. Steps: In file Polyonic/src/app.js ( Changes in code can be VIEWED HERE ) 1) Added const Menu = electron.Menu after line const electron = require('electron') 2) Added a sample MenuItem let template = [{ label: 'Edit', submenu: [{ label: 'Undo', accelerator: 'CmdOrCtrl+Z', role: 'undo' }, { label: 'Redo', accelerator: 'Shift+CmdOrCtrl+Z', role: 'redo' }, { type: 'separator' }, { label: 'Cut', accelerator: 'CmdOrCtrl+X', role: 'cut' }, { label: 'Copy', accelerator: 'CmdOrCtrl+C', role: 'copy' }, { label: 'Paste', accelerator: 'CmdOrCtrl+V', role: 'paste' }, { label: 'Select All', accelerator: 'CmdOrCtrl+A', role: 'selectall' }] }]; 3) In app.on-ready hook (around Line 76).... added const menu = Menu.buildFromTemplate(template) Menu.setApplicationMenu(menu)

Copy of my Polyonic/src/app.js can be found HERE

lapak10 commented 6 years ago

This was not an issue as I noticed there was autoHideMenuBar: true in app.js which when changed to autoHideMenuBar: false worked as expected.

paulsutherland commented 6 years ago

Thanks for feeding back and closing the issue. 🥇