Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add window removeMenu() method (backport: 5-0-x) #16657

Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -659,6 +659,13 @@ void TopLevelWindow::SetMenu(v8::Isolate* isolate, v8::Local<v8::Value> value) {
}
}

void TopLevelWindow::RemoveMenu() {
mate::Handle<Menu> menu;

This comment has been minimized.

Copy link
@deepak1556

deepak1556 Feb 4, 2019

Member

What is the purpose of this variable ?

This comment has been minimized.

Copy link
@codebytere

codebytere Feb 4, 2019

Member

will remove in follow-up

This comment has been minimized.

Copy link
@deepak1556

deepak1556 Feb 4, 2019

Member

Thanks!


menu_.Reset();
window_->SetMenu(nullptr);
}

void TopLevelWindow::SetParentWindow(v8::Local<v8::Value> value,
mate::Arguments* args) {
if (IsModal()) {
@@ -1103,6 +1110,7 @@ void TopLevelWindow::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setContentProtection", &TopLevelWindow::SetContentProtection)
.SetMethod("setFocusable", &TopLevelWindow::SetFocusable)
.SetMethod("setMenu", &TopLevelWindow::SetMenu)
.SetMethod("removeMenu", &TopLevelWindow::RemoveMenu)
.SetMethod("setParentWindow", &TopLevelWindow::SetParentWindow)
.SetMethod("setBrowserView", &TopLevelWindow::SetBrowserView)
.SetMethod("addBrowserView", &TopLevelWindow::AddBrowserView)
@@ -165,6 +165,7 @@ class TopLevelWindow : public mate::TrackableObject<TopLevelWindow>,
void SetContentProtection(bool enable);
void SetFocusable(bool focusable);
void SetMenu(v8::Isolate* isolate, v8::Local<v8::Value> menu);
void RemoveMenu();
void SetParentWindow(v8::Local<v8::Value> value, mate::Arguments* args);
virtual void SetBrowserView(v8::Local<v8::Value> value);
virtual void AddBrowserView(v8::Local<v8::Value> value);
@@ -8,6 +8,15 @@ The `FIXME` string is used in code comments to denote things that should be fixe

# Planned Breaking API Changes (6.0)

## `win.setMenu(null)`

```js
// Deprecated
win.setMenu(null)
// Replace with
win.removeMenu()
```

## `electron.screen` in renderer process

```js
@@ -64,7 +73,7 @@ A new API, `protocol.registerSchemesAsPrivileged` has been added and should be u

# Planned Breaking API Changes (4.0)

The following list includes the breaking API changes planned for Electron 4.0.
The following list includes the breaking API changes made in Electron 4.0.

## `app.makeSingleInstance`

@@ -1308,8 +1308,11 @@ Same as `webContents.reload`.

* `menu` Menu | null

Sets the `menu` as the window's menu bar, setting it to `null` will remove the
menu bar.
Sets the `menu` as the window's menu bar.

#### `win.removeMenu()` _Linux_ _Windows_

Remove the window's menu bar.

#### `win.setProgressBar(progress[, options])`

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.