You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was taking a look at the default app. There's a menu item that causes the app to enter fullscreen, but once in fullscreen the menu item doesn't change from "Enter Fullscreen" to "Exit Fullscreen". This means that once you enter fullscreen though the menu, you cannot exit it.
It seems to me that there should be some way of dynamically changing a menu item's label inside of its own callback. I couldn't find a way to do this without removing the entire menu, creating a new one, then adding it back, but that felt rather heavy handed. Another way to do this would be by removing the single menu item and adding a different one in its place (essentially swapping it out), but there doesn't seem to be any more functionality allowing this than there is for merely changing a label. (A request for the addition of Menu.remove() can be found here.)
I would be willing to contribute to this if given some pointers. It should be noted that I haven't worked with CoffeeScript except in passing, but I can most likely figure it out.
The menu implementation in atom-shell used Chromium's menu library, which provided very limited support for dynamic menus and didn't support removing or adding menu items after the menu was created, so there is no simple way to fix this. But after I figured out a way to implement #528, this would become possible.
I'm closing this since this is a duplicate of #528.
Activity
soh1988 commentedon Aug 26, 2014
You can create a toggle Fullscreen
{
label: 'Toogle Fullscreen',
accelerator: 'CommandOrControl+F',
click: function() { mainWindow.setFullScreen( !mainWindow.isFullScreen() ); }
}
ConnorKrammer commentedon Aug 28, 2014
I figured out how to do that, but from a UX perspective having a more explicit label is the better option.
ConnorKrammer commentedon Sep 1, 2014
@zcbenz any thoughts?
zcbenz commentedon Sep 1, 2014
The menu implementation in atom-shell used Chromium's menu library, which provided very limited support for dynamic menus and didn't support removing or adding menu items after the menu was created, so there is no simple way to fix this. But after I figured out a way to implement #528, this would become possible.
I'm closing this since this is a duplicate of #528.
ConnorKrammer commentedon Sep 3, 2014
Thanks.