]> khamidou — GitHub mirrors - electron.git/commitdiff
docs: Menu bar APIs
authorCheng Zhao <zcbenz@gmail.com>
Wed, 12 Nov 2014 12:49:38 +0000 (20:49 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 12 Nov 2014 12:49:38 +0000 (20:49 +0800)
docs/api/browser-window.md

index 222df14dabc825c8c201bc104b3b2ac346017827..711a09d10cea8633b3e2d5c6f7c5b2c72d2b22da 100644 (file)
@@ -506,6 +506,31 @@ On Linux platform, only supports Unity desktop environment, you need to specify
 the `*.desktop` file name to `desktopName` field in `package.json`. By default,
 it will assume `app.getName().desktop`.
 
+### BrowserWindow.setAutoHideMenuBar(hide)
+
+* `hide` Boolean
+
+Sets whether the window menu bar should hide itself automatically. Once set the
+menu bar will only show when users press the single `Alt` key.
+
+If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
+hide it immediately.
+
+### BrowserWindow.isMenuBarAutoHide()
+
+Returns whether menu bar automatically hides itself.
+
+### BrowserWindow.setMenuBarVisibility(visible)
+
+* `visible` Boolean
+
+Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
+can still bring up the menu bar by pressing the single `Alt` key.
+
+### BrowserWindow.isMenuBarVisible()
+
+Returns whether the menu bar is visible.
+
 ## Class: WebContents
 
 A `WebContents` is responsible for rendering and controlling a web page.