AlexTorresDev / custom-electron-titlebar

Custom electon title bar inpire on VS Code title bar
MIT License
862 stars 141 forks source link

With a menu it is not displayed, with 3 or 4 menus it is displayed, is there a minimum? #216

Open Madriix opened 1 year ago

Madriix commented 1 year ago

https://github.com/AlexTorresDev/custom-electron-titlebar/blob/main/example/main.js#L62 By entering only one item (only Simple O&ptions and removing the others), it does not display the menu, but when I enter 3 or 4 items, it displays a menu. How can I make it display with just one menu?

Example:

// Custom menu
const exampleMenuTemplate = [
    {
        label: 'Simple O&ptions',
        submenu: [
            {
                label: 'Quit',
                click: () => app.quit()
            }
        ]
    }
]
Madriix commented 5 months ago

I may have found a trick to display only one menu. It's by adding 2 dummy items to the array:

{
  label: null
},
{
  label: null
}

Like this:

const exampleMenuTemplate = [
    {
        label: 'Simple O&ptions',
        submenu: [
            {
                label: 'Quit',
                click: () => app.quit()
            }
        ]
    },

{
  label: null
},
{
  label: null
}
]