remove screen.getMenuBarHeight() deprecation
This commit is contained in:
parent
cc30f4c4fd
commit
72c63a10ee
6 changed files with 0 additions and 48 deletions
|
@ -145,9 +145,6 @@ void Screen::BuildPrototype(v8::Isolate* isolate,
|
||||||
.SetMethod("dipToScreenPoint", &display::win::ScreenWin::DIPToScreenPoint)
|
.SetMethod("dipToScreenPoint", &display::win::ScreenWin::DIPToScreenPoint)
|
||||||
.SetMethod("screenToDipRect", &ScreenToDIPRect)
|
.SetMethod("screenToDipRect", &ScreenToDIPRect)
|
||||||
.SetMethod("dipToScreenRect", &DIPToScreenRect)
|
.SetMethod("dipToScreenRect", &DIPToScreenRect)
|
||||||
#endif
|
|
||||||
#if defined(OS_MACOSX)
|
|
||||||
.SetMethod("getMenuBarHeight", &Screen::getMenuBarHeight)
|
|
||||||
#endif
|
#endif
|
||||||
.SetMethod("getDisplayMatching", &Screen::GetDisplayMatching);
|
.SetMethod("getDisplayMatching", &Screen::GetDisplayMatching);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,10 +40,6 @@ class Screen : public mate::EventEmitter<Screen>,
|
||||||
display::Display GetDisplayNearestPoint(const gfx::Point& point);
|
display::Display GetDisplayNearestPoint(const gfx::Point& point);
|
||||||
display::Display GetDisplayMatching(const gfx::Rect& match_rect);
|
display::Display GetDisplayMatching(const gfx::Rect& match_rect);
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
|
||||||
int getMenuBarHeight();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// display::DisplayObserver:
|
// display::DisplayObserver:
|
||||||
void OnDisplayAdded(const display::Display& new_display) override;
|
void OnDisplayAdded(const display::Display& new_display) override;
|
||||||
void OnDisplayRemoved(const display::Display& old_display) override;
|
void OnDisplayRemoved(const display::Display& old_display) override;
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
// Copyright (c) 2017 GitHub, Inc.
|
|
||||||
// Use of this source code is governed by the MIT license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import "atom/browser/api/atom_api_screen.h"
|
|
||||||
|
|
||||||
namespace atom {
|
|
||||||
|
|
||||||
namespace api {
|
|
||||||
|
|
||||||
// TODO(codebytere): deprecated; remove in 3.0
|
|
||||||
int Screen::getMenuBarHeight() {
|
|
||||||
return [[NSApp mainMenu] menuBarHeight];
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace api
|
|
||||||
|
|
||||||
} // namespace atom
|
|
|
@ -95,10 +95,6 @@ Returns [`Point`](structures/point.md)
|
||||||
|
|
||||||
The current absolute position of the mouse pointer.
|
The current absolute position of the mouse pointer.
|
||||||
|
|
||||||
### `screen.getMenuBarHeight()` _macOS_
|
|
||||||
|
|
||||||
Returns `Integer` - The height of the menu bar in pixels.
|
|
||||||
|
|
||||||
### `screen.getPrimaryDisplay()`
|
### `screen.getPrimaryDisplay()`
|
||||||
|
|
||||||
Returns [`Display`](structures/display.md) - The primary display.
|
Returns [`Display`](structures/display.md) - The primary display.
|
||||||
|
|
|
@ -40,15 +40,6 @@ nativeImage.createFromBuffer(buffer, {
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
## `screen`
|
|
||||||
|
|
||||||
```js
|
|
||||||
// Deprecated
|
|
||||||
screen.getMenuBarHeight()
|
|
||||||
// Replace with
|
|
||||||
screen.getPrimaryDisplay().workArea
|
|
||||||
```
|
|
||||||
|
|
||||||
## `session`
|
## `session`
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
|
@ -1,17 +1,8 @@
|
||||||
const {EventEmitter} = require('events')
|
const {EventEmitter} = require('events')
|
||||||
const {deprecate} = require('electron')
|
|
||||||
const {screen, Screen} = process.atomBinding('screen')
|
const {screen, Screen} = process.atomBinding('screen')
|
||||||
|
|
||||||
// Screen is an EventEmitter.
|
// Screen is an EventEmitter.
|
||||||
Object.setPrototypeOf(Screen.prototype, EventEmitter.prototype)
|
Object.setPrototypeOf(Screen.prototype, EventEmitter.prototype)
|
||||||
EventEmitter.call(screen)
|
EventEmitter.call(screen)
|
||||||
|
|
||||||
const nativeFn = screen.getMenuBarHeight
|
|
||||||
screen.getMenuBarHeight = function () {
|
|
||||||
if (!process.noDeprecations) {
|
|
||||||
deprecate.warn('screen.getMenuBarHeight', 'screen.getPrimaryDisplay().workArea')
|
|
||||||
}
|
|
||||||
return nativeFn.call(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = screen
|
module.exports = screen
|
||||||
|
|
Loading…
Add table
Reference in a new issue